diff --git a/test/bytecode_2.7_run/04_assert_continue.pyc b/test/bytecode_2.7_run/04_assert_continue.pyc-notyet similarity index 100% rename from test/bytecode_2.7_run/04_assert_continue.pyc rename to test/bytecode_2.7_run/04_assert_continue.pyc-notyet diff --git a/test/simple_source/bug24/03_iftrue.py b/test/simple_source/bug24/03_iftrue.py new file mode 100644 index 00000000..8d22a8a7 --- /dev/null +++ b/test/simple_source/bug24/03_iftrue.py @@ -0,0 +1,10 @@ +# Python 2.4 (and before?) bug in handling unconditional "else if true" +# Doesn't occur in Python > 2.4 +# From Issue #187 +def unconditional_if_true_24(foo): + if not foo: + pass + elif 1: + pass + else: + return None diff --git a/test/simple_source/bug27+/06_raise.py b/test/simple_source/bug27+/06_raise.py new file mode 100644 index 00000000..c042aa5f --- /dev/null +++ b/test/simple_source/bug27+/06_raise.py @@ -0,0 +1,22 @@ +# Bug in Python 2.7 is code creating a (useless) JUMP_ABSOLUTE to the instruction right after +# the "raise" which causes the + +# RUNNABLE! +def testit(a, b): + if a: + if not b: + raise AssertionError("test JUMP_ABSOLUTE to next instruction") + +def testit2(a, b): + if a: + if not b: + raise AssertionError("test with dead code after raise") + x = 10 + +testit(False, True) +testit(False, False) +testit(True, True) + +testit2(False, True) +testit2(False, False) +testit2(True, True) diff --git a/test/simple_source/bug31/01_try_else.py b/test/simple_source/bug31/01_try_else.py index c49dedde..e0c2bc2d 100644 --- a/test/simple_source/bug31/01_try_else.py +++ b/test/simple_source/bug31/01_try_else.py @@ -4,6 +4,7 @@ # try. In 3.x we not distinguising this jump out of the loop with a jump to the # end of the "try". +# RUNNABLE! def testit(stmts): # Bug was confusing When the except jumps back to the beginning of the block diff --git a/uncompyle6/parsers/parse27.py b/uncompyle6/parsers/parse27.py index 46b416db..b22d1f5a 100644 --- a/uncompyle6/parsers/parse27.py +++ b/uncompyle6/parsers/parse27.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2018 Rocky Bernstein +# Copyright (c) 2016-2019 Rocky Bernstein # Copyright (c) 2005 by Dan Pascu # Copyright (c) 2000-2002 by hartmut Goebel @@ -208,8 +208,6 @@ class Python27Parser(Python2Parser): self.check_reduce['and'] = 'AST' # self.check_reduce['or'] = 'AST' self.check_reduce['raise_stmt1'] = 'AST' - self.check_reduce['assert'] = 'AST' - self.check_reduce['assert2'] = 'AST' self.check_reduce['list_if_not'] = 'AST' self.check_reduce['list_if'] = 'AST' self.check_reduce['conditional_true'] = 'AST'