diff --git a/test/bytecode_2.6/03_if_elif.pyc b/test/bytecode_2.6/03_if_elif.pyc new file mode 100644 index 00000000..3e033757 Binary files /dev/null and b/test/bytecode_2.6/03_if_elif.pyc differ diff --git a/test/simple_source/stmts/03_if_elif.py b/test/simple_source/stmts/03_if_elif.py new file mode 100644 index 00000000..b2e6dbac --- /dev/null +++ b/test/simple_source/stmts/03_if_elif.py @@ -0,0 +1,8 @@ +# 2.6.9 symbols.py +# Bug in 2.6 is having multple COME_FROMs due to the +# "and" in the "if" clause +if __name__: + if __file__ and name: + pass + elif name: + pass diff --git a/uncompyle6/parsers/parse26.py b/uncompyle6/parsers/parse26.py index ab17a6dd..35dc247e 100644 --- a/uncompyle6/parsers/parse26.py +++ b/uncompyle6/parsers/parse26.py @@ -79,7 +79,7 @@ class Python26Parser(Python2Parser): jb_cont ::= CONTINUE jb_cf_pop ::= JUMP_BACK come_froms POP_TOP - ja_cf_pop ::= JUMP_ABSOLUTE come_from_pop + ja_cf_pop ::= JUMP_ABSOLUTE come_froms POP_TOP jf_cf_pop ::= JUMP_FORWARD come_froms POP_TOP bp_come_from ::= POP_BLOCK COME_FROM @@ -143,6 +143,7 @@ class Python26Parser(Python2Parser): return_stmt ::= ret_expr RETURN_VALUE come_from_pop return_if_stmt ::= ret_expr RETURN_END_IF come_from_pop + iflaststmtc ::= testexpr c_stmts_opt JUMP_ABSOLUTE else_suitec COME_FROM iflaststmtl ::= testexpr c_stmts_opt JUMP_BACK come_from_pop iflaststmt ::= testexpr c_stmts_opt JUMP_ABSOLUTE come_from_pop """