liftoff / pyminifier

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

Indentation error: expected an indented block #44

Open bertrandhaut opened 9 years ago

bertrandhaut commented 9 years ago

Dear,

Here is a problem I was able to reproduce.

With this test code:

class MyClass(object):
   def __init__(self):
      self.a = 10

   def __repr__(self):
       return str(self.a)

c = MyClass()

print(c)

and the command pyminifier -O -o out.py test.py

I get the following code:

class W(l):
l=object
T=str
D=print
 def __init__(K):
  K.a=10
 def __repr__(K):
  return T(K.a)
c=W()
D(c)

leading to the error (with python 3.4.3) :

  File "out.py", line 2
    l=object
    ^
IndentationError: expected an indented block

pyminifier version : 2.2

Any idea how to solve this ?

NikolaiT commented 9 years ago

Also experiencing this error. The minification process is not completeley correct.