diff --git a/test/simple_source/bug14/01_print.py b/test/simple_source/bug14/01_print.py index dae12a98..e34c907d 100644 --- a/test/simple_source/bug14/01_print.py +++ b/test/simple_source/bug14/01_print.py @@ -1,4 +1,5 @@ # Python 1.4 aifc.py +# Something weird about the final "print" and PRINT_NL_CONT followed by PRINT_NL def _readmark(self, markers): if self._markers: print 'marker', else: print 'markers', diff --git a/test/simple_source/bug14/02_continue.py b/test/simple_source/bug14/02_continue.py new file mode 100644 index 00000000..761d2236 --- /dev/null +++ b/test/simple_source/bug14/02_continue.py @@ -0,0 +1,11 @@ +# Python 1.4 cgi.py +# Bug was in "continue" detection. +# 1.4 doesn't have lnotab and our CONTINUE detection is off. +def parse_multipart(params, pdict): + while params: + if params.has_key('name'): + params = None + else: + continue + + return None diff --git a/test/stdlib/compile_file_1x.py b/test/stdlib/compile-file-1x.py similarity index 100% rename from test/stdlib/compile_file_1x.py rename to test/stdlib/compile-file-1x.py diff --git a/uncompyle6/parsers/parse14.py b/uncompyle6/parsers/parse14.py index 10f74ff1..51289d0d 100644 --- a/uncompyle6/parsers/parse14.py +++ b/uncompyle6/parsers/parse14.py @@ -25,6 +25,10 @@ class Python14Parser(Python15Parser): print_items_nl_stmt ::= expr PRINT_ITEM_CONT print_items_opt PRINT_NEWLINE_CONT + + # 1.4 doesn't have linenotab, and although this shouldn't + # be a show stopper, our CONTINUE detection is off here. + continue ::= JUMP_BACK """ def __init__(self, debug_parser=PARSER_DEFAULT_DEBUG):