diff --git a/uncompyle6/parsers/parse23.py b/uncompyle6/parsers/parse23.py index f39f7954..160c4de1 100644 --- a/uncompyle6/parsers/parse23.py +++ b/uncompyle6/parsers/parse23.py @@ -18,6 +18,9 @@ class Python23Parser(Python24Parser): # of Python _while1test ::= SETUP_LOOP JUMP_FORWARD JUMP_IF_FALSE POP_TOP COME_FROM + while1stmt ::= _while1test l_stmts_opt JUMP_BACK + POP_TOP POP_BLOCK COME_FROM + while1stmt ::= _while1test l_stmts_opt JUMP_BACK COME_FROM POP_TOP POP_BLOCK COME_FROM diff --git a/uncompyle6/parsers/parse26.py b/uncompyle6/parsers/parse26.py index 38ede40e..47c0ac0b 100644 --- a/uncompyle6/parsers/parse26.py +++ b/uncompyle6/parsers/parse26.py @@ -23,7 +23,7 @@ class Python26Parser(Python2Parser): JUMP_IF_FALSE POP_TOP POP_TOP designator POP_TOP try_middle ::= JUMP_FORWARD COME_FROM except_stmts - POP_TOP END_FINALLY COME_FROM + come_from_pop END_FINALLY COME_FROM try_middle ::= jmp_abs COME_FROM except_stmts POP_TOP END_FINALLY @@ -47,7 +47,9 @@ class Python26Parser(Python2Parser): _ifstmts_jump ::= c_stmts_opt JUMP_FORWARD COME_FROM POP_TOP + except_suite ::= c_stmts_opt JUMP_FORWARD come_from_pop except_suite ::= c_stmts_opt JUMP_FORWARD POP_TOP + except_suite ::= c_stmts_opt jmp_abs come_from_pop # Python 3 also has this. come_froms ::= come_froms COME_FROM @@ -152,8 +154,8 @@ class Python26Parser(Python2Parser): return_stmt ::= ret_expr RETURN_VALUE POP_TOP return_if_stmt ::= ret_expr RETURN_END_IF POP_TOP - iflaststmtl ::= testexpr c_stmts_opt JUMP_BACK POP_TOP - iflaststmt ::= testexpr c_stmts_opt JUMP_ABSOLUTE POP_TOP + iflaststmtl ::= testexpr c_stmts_opt JUMP_BACK come_from_pop + iflaststmt ::= testexpr c_stmts_opt JUMP_ABSOLUTE come_from_pop while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK COME_FROM diff --git a/uncompyle6/scanners/scanner2.py b/uncompyle6/scanners/scanner2.py index ad6fb22a..84f74e6c 100644 --- a/uncompyle6/scanners/scanner2.py +++ b/uncompyle6/scanners/scanner2.py @@ -879,7 +879,7 @@ class Scanner2(scan.Scanner): and self.code[offset+4] == self.opc.END_FINALLY))): # FIXME: rocky: I think we need something like this... - if offset not in set(self.ignore_if): + if offset not in set(self.ignore_if) or self.version == 2.7: targets[label] = targets.get(label, []) + [offset] # targets[label] = targets.get(label, []) + [offset] pass