liftoff / pyminifier

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

remove_comments_and_docstrings() has problems with non-indented multiline strings #59

Open Herst opened 8 years ago

Herst commented 8 years ago

Using minification.remove_comments_and_docstrings() or similar the following

def test1():
 return "a" + \
 "b"

def test2():
 return "c" + \
"d"

turns into

def test1():
 return "a" + "b"

def test2():
 return "c" +
LuisAlejandro commented 8 years ago

Also happens with:

classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Topic :: Software Development :: Code Generators",
"Topic :: Software Development :: Libraries :: Python Modules",
]

which converts to:

classifiers = [
,
,
,
,
,
,
,
,
,
,
,
]