diff --git a/test/bytecode_2.6/03_tryelse_continue.pyc b/test/bytecode_2.6/03_tryelse_continue.pyc new file mode 100644 index 00000000..2f722f1e Binary files /dev/null and b/test/bytecode_2.6/03_tryelse_continue.pyc differ diff --git a/test/simple_source/bug26/03_tryelse_continue.py b/test/simple_source/bug26/03_tryelse_continue.py new file mode 100644 index 00000000..d6cb3e5d --- /dev/null +++ b/test/simple_source/bug26/03_tryelse_continue.py @@ -0,0 +1,14 @@ +# 2.6- Try/else in a loop with a continue which +# requires a tryelsestmtc +# From 2.6- test_codecs.py +def test_specific_values(self): + for flags in self: + if flags: + try: + self = 1 + except ValueError: + continue + else: + self = 2 + + self = 3 diff --git a/test/stdlib/runtests.sh b/test/stdlib/runtests.sh index 421d319c..46a6c61d 100755 --- a/test/stdlib/runtests.sh +++ b/test/stdlib/runtests.sh @@ -53,18 +53,9 @@ nn [test_zipfile64.py]=1 # Runs ok but takes 204 seconds ;; 2.6) SKIP_TESTS=( - [test_cmath.py]=1 # Control flow? - [test_codecs.py]=1 # need to fix tryelse - [test_coercion.py]=1 # Control flow? - [test_decorators.py]=1 # Syntax Error - look at - [test_frozen.py]=1 # Control flow? - [test_ftplib.py]=1 # Control flow? [test_grp.py]=1 # Long test - might work Control flow? - [test_imp.py]=1 [test_pwd.py]=1 # Long test - might work? Control flow? - [test_queue.py]=1 # Control flow? [test_re.py]=1 # Probably Control flow? - [test_strftime.py]=1 [test_trace.py]=1 # Line numbers are expected to be different # .pyenv/versions/2.6.9/lib/python2.6/lib2to3/refactor.pyc # .pyenv/versions/2.6.9/lib/python2.6/mailbox.pyc diff --git a/uncompyle6/parsers/parse26.py b/uncompyle6/parsers/parse26.py index 5dd388eb..ec204646 100644 --- a/uncompyle6/parsers/parse26.py +++ b/uncompyle6/parsers/parse26.py @@ -42,6 +42,8 @@ class Python26Parser(Python2Parser): except_handler else_suite come_froms tryelsestmtl ::= SETUP_EXCEPT suite_stmts_opt POP_BLOCK except_handler else_suitel + tryelsestmtc ::= SETUP_EXCEPT suite_stmts_opt POP_BLOCK + except_handler else_suitec _ifstmts_jump ::= c_stmts_opt JUMP_FORWARD COME_FROM POP_TOP