diff --git a/test/bytecode_3.8/03_pop_top.pyc b/test/bytecode_3.8/03_pop_top.pyc new file mode 100644 index 00000000..5bd124b1 Binary files /dev/null and b/test/bytecode_3.8/03_pop_top.pyc differ diff --git a/test/bytecode_3.8_run/04_and_del.pyc b/test/bytecode_3.8_run/04_and_del.pyc new file mode 100644 index 00000000..35c02993 Binary files /dev/null and b/test/bytecode_3.8_run/04_and_del.pyc differ diff --git a/test/simple_source/bug30/04_and_del.py b/test/simple_source/bug30/04_and_del.py index 51b452e6..b161026f 100644 --- a/test/simple_source/bug30/04_and_del.py +++ b/test/simple_source/bug30/04_and_del.py @@ -1,5 +1,7 @@ # From 2.5.6 osxemxpath.py # Bug is in getting "and" and "del" correct + +# This is RUNNABLE! def normpath(comps): i = 0 while i < len(comps): diff --git a/uncompyle6/semantics/transform.py b/uncompyle6/semantics/transform.py index 63d1755d..d8c98902 100644 --- a/uncompyle6/semantics/transform.py +++ b/uncompyle6/semantics/transform.py @@ -75,9 +75,11 @@ class TreeTransform(GenericASTTraversal, object): if testexpr.kind != "testexpr": return node - if node.kind == "ifstmt": + if node.kind in ("ifstmt", "ifstmtl"): ifstmts_jump = node[1] - if node[1] != "_ifstmts_jump": + if ifstmts_jump == "_ifstmts_jumpl" and ifstmts_jump[0] == "_ifstmts_jump": + ifstmts_jump = ifstmts_jump[0] + elif ifstmts_jump != "_ifstmts_jump": return node stmts = ifstmts_jump[0] else: @@ -156,7 +158,7 @@ class TreeTransform(GenericASTTraversal, object): pass return node - n_iflaststmtl = n_ifstmt + n_ifstmtl = n_iflaststmtl = n_ifstmt # preprocess is used for handling chains of # if elif elif