diff --git a/test/bytecode_2.7/04_try_tryelse.pyc b/test/bytecode_2.7/04_try_tryelse.pyc new file mode 100644 index 00000000..0606878d Binary files /dev/null and b/test/bytecode_2.7/04_try_tryelse.pyc differ diff --git a/test/simple_source/bug27+/04_try_tryelse.py b/test/simple_source/bug27+/04_try_tryelse.py new file mode 100644 index 00000000..366f3c6f --- /dev/null +++ b/test/simple_source/bug27+/04_try_tryelse.py @@ -0,0 +1,21 @@ +# From 2.7 test_normalize.py +# Bug has to to with finding the end of the tryelse block. I think thrown +# off by the "continue". In instructions the COME_FROM for END_FINALLY +# was at the wrong offset because some sort of "rtarget" was adjust. + +# When control flow is in place this logic in the code will be simplified +def test_main(self, c1): + for line in self: + try: + c1 = 6 + except: + if c1: + try: + c1 = 5 + except: + pass + else: + c1 = 1 + continue + + pass diff --git a/uncompyle6/scanners/scanner2.py b/uncompyle6/scanners/scanner2.py index b501d234..2b29a249 100644 --- a/uncompyle6/scanners/scanner2.py +++ b/uncompyle6/scanners/scanner2.py @@ -816,6 +816,7 @@ class Scanner2(Scanner): rtarget = pre_rtarget else: rtarget = pre_rtarget + pre_rtarget = pre[rtarget] # Does the "jump if" jump beyond a jump op? # That is, we have something like: