diff --git a/test/bytecode_2.6/04_withas.pyc b/test/bytecode_2.6/04_withas.pyc index 31d0d29c..2c8086ab 100644 Binary files a/test/bytecode_2.6/04_withas.pyc and b/test/bytecode_2.6/04_withas.pyc differ diff --git a/test/bytecode_2.7/04_withas.pyc b/test/bytecode_2.7/04_withas.pyc index 33c302a2..1242af29 100644 Binary files a/test/bytecode_2.7/04_withas.pyc and b/test/bytecode_2.7/04_withas.pyc differ diff --git a/test/bytecode_3.0/04_withas.pyc b/test/bytecode_3.0/04_withas.pyc index 09bda8ad..da571967 100644 Binary files a/test/bytecode_3.0/04_withas.pyc and b/test/bytecode_3.0/04_withas.pyc differ diff --git a/test/bytecode_3.1/04_withas.pyc b/test/bytecode_3.1/04_withas.pyc index 8259c657..c1c0b0a6 100644 Binary files a/test/bytecode_3.1/04_withas.pyc and b/test/bytecode_3.1/04_withas.pyc differ diff --git a/test/bytecode_3.6/04_withas.pyc b/test/bytecode_3.6/04_withas.pyc index 95117e15..c5f2189a 100644 Binary files a/test/bytecode_3.6/04_withas.pyc and b/test/bytecode_3.6/04_withas.pyc differ diff --git a/test/bytecode_3.7/04_withas.pyc b/test/bytecode_3.7/04_withas.pyc index ee332c8f..fda61850 100644 Binary files a/test/bytecode_3.7/04_withas.pyc and b/test/bytecode_3.7/04_withas.pyc differ diff --git a/test/simple_source/stmts/04_withas.py b/test/simple_source/stmts/04_withas.py index b21452db..f3c65a80 100644 --- a/test/simple_source/stmts/04_withas.py +++ b/test/simple_source/stmts/04_withas.py @@ -17,6 +17,20 @@ def withas_bug(self, nested, a, b): with nested(a(), b()) as (x, y): 1 // 0 +# From 3.7.7 test_functools.py +# Bug is a unreachable code after "return" +def test_invalid_registrations(x): + return + with x: + x = 1 + +# From 3.7.7 test_re.py +# Bug was hooking in c_with. +def test_re_tests(tests): + for t in tests: + with a: + continue + # Adapted from 3.8 distutils/command/config.py # In 3.8 the problem was in handling "with .. as" code def _gen_temp_sourcefile(x, a, headers, lang): diff --git a/uncompyle6/semantics/check_ast.py b/uncompyle6/semantics/check_ast.py index 3c5f4b78..203ff0a9 100644 --- a/uncompyle6/semantics/check_ast.py +++ b/uncompyle6/semantics/check_ast.py @@ -14,6 +14,7 @@ def checker(ast, in_loop, errors): return in_loop = ( in_loop + or ast.kind.startswith("for") or ast.kind.startswith("while") or ast.kind.startswith("async_for") )