pyminifier icon indicating copy to clipboard operation
pyminifier copied to clipboard

Pyminifier kills singleton tuples

Open EricBrunel opened this issue 9 years ago • 0 comments

Singleton tuples are killed by pyminifier: something like "(42,)" is turned into "(42)" by the minification process, which doesn't mean the same thing at all. This happens in minification.py, in the reduce_operators function. At the beginning of the 'else' of the second 'if' in the 'for' loop (line 217 in the version I have), replacing: if token_string in ('}', ')', ']'): with: if token_string in ('}', ']'): solves the issue.

EricBrunel avatar Oct 03 '16 13:10 EricBrunel