liftoff / pyminifier

Pyminifier is a Python code minifier, obfuscator, and compressor.
GNU General Public License v3.0
1.47k stars 224 forks source link

minifier gives invalid output #145

Open Drulludanni opened 1 year ago

Drulludanni commented 1 year ago
from time import time
class Class():
    def __init__(self, parent = None):
        self.asdf = time()

if __name__ == '__main__':
    c = Class()

gets converted to

from z import time
o=None
class J():
 def __init__(n,parent=o):
  n.asdf=z()
if __name__=='__main__':
 c=J()

which is clearly wrong since z is never defined, in this case it should minify to from time import time as z then the code would run as expected