diff --git a/test/stdlib/runtests.sh b/test/stdlib/runtests.sh index e347672a..6e2a4320 100755 --- a/test/stdlib/runtests.sh +++ b/test/stdlib/runtests.sh @@ -32,11 +32,11 @@ typeset -A SKIP_TESTS case $PYVERSION in 2.4) SKIP_TESTS=( + [test_decimal.py]=1 # [test_dis.py]=1 # We change line numbers - duh! [test_grp.py]=1 # Long test - might work Control flow? [test_pep247.py]=1 # Long test - might work? Control flow? [test_pwd.py]=1 # Long test - might work? Control flow? - [test_pyclbr.py]=1 # Investigate [test_socketserver.py]=1 # -- test takes too long to run: 40 seconds [test_threading.py]=1 # test takes too long to run: 11 seconds [test_thread.py]=1 # test takes too long to run: 36 seconds diff --git a/uncompyle6/parsers/parse2.py b/uncompyle6/parsers/parse2.py index 6089b296..66be0c71 100644 --- a/uncompyle6/parsers/parse2.py +++ b/uncompyle6/parsers/parse2.py @@ -641,6 +641,7 @@ class Python2Parser(PythonParser): self.check_reduce["tryelsestmtl"] = "AST" self.check_reduce["aug_assign2"] = "AST" self.check_reduce["or"] = "AST" + self.check_reduce["ifstmt"] = "tokens" # self.check_reduce['_stmts'] = 'AST' # Dead code testing... @@ -665,6 +666,14 @@ class Python2Parser(PythonParser): jmp_false = ast[1] jump_target = jmp_false[0].attr return jump_target > tokens[last].off2int() + elif rule == ("ifstmt", ("testexpr", "_ifstmts_jump")): + for i in range(last-1, last-4, -1): + t = tokens[i] + if t == "JUMP_FORWARD": + return t.attr > tokens[min(last, len(tokens)-1)].off2int() + elif t not in ("POP_TOP", "COME_FROM"): + break + pass elif lhs in ("raise_stmt1",): # We will assume 'LOAD_ASSERT' will be handled by an assert grammar rule return tokens[first] == "LOAD_ASSERT" and (last >= len(tokens))