diff --git a/test/simple_source/bug26/03_tryelse_continue.py b/test/simple_source/bug26/03_tryelse_continue.py index e1af1dd1..74c13ae1 100644 --- a/test/simple_source/bug26/03_tryelse_continue.py +++ b/test/simple_source/bug26/03_tryelse_continue.py @@ -21,7 +21,6 @@ def call(*args): except KeyError: return 2 except TypeError: - # Unhashable argument return 3 @@ -39,3 +38,16 @@ def do_jump(self, arg): arg(3) except ValueError: arg(4) + +# From 2.6.9 smtpd.py +# Bug was that the for can cause multiple COME_FROMs at the +# of the try block +def _deliver(self, s, mailfrom, rcpttos): + try: + mailfrom(1) + except RuntimeError: + mailfrom(2) + except IndexError: + for r in s: + mailfrom() + return diff --git a/uncompyle6/parsers/parse26.py b/uncompyle6/parsers/parse26.py index 524bb482..505c0a8c 100644 --- a/uncompyle6/parsers/parse26.py +++ b/uncompyle6/parsers/parse26.py @@ -22,7 +22,7 @@ class Python26Parser(Python2Parser): JUMP_IF_FALSE POP_TOP POP_TOP store POP_TOP except_handler ::= JUMP_FORWARD COME_FROM except_stmts - come_from_pop END_FINALLY come_froms + come_froms_pop END_FINALLY come_froms except_handler ::= JUMP_FORWARD COME_FROM except_stmts END_FINALLY come_froms