From e90455dcb80e9d291aad67e02ab52f3b2d88922a Mon Sep 17 00:00:00 2001 From: rocky Date: Thu, 13 Feb 2020 04:31:16 -0500 Subject: [PATCH] transform ifelseif bugs --- test/stdlib/3.7-exclude.sh | 1 + uncompyle6/semantics/transform.py | 13 ++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/stdlib/3.7-exclude.sh b/test/stdlib/3.7-exclude.sh index 992dbb8b..1e0ce7db 100644 --- a/test/stdlib/3.7-exclude.sh +++ b/test/stdlib/3.7-exclude.sh @@ -135,6 +135,7 @@ SKIP_TESTS=( # 306 unit-test files in about 19 minutes if (( batch )) ; then + SKIP_TESTS[test_capi.py]=1 # more than 15 secs to run on POWER SKIP_TESTS[test_dbm_gnu.py]=1 # fails on its own on POWER SKIP_TESTS[test_distutils.py]=1 SKIP_TESTS[test_fileio.py]=1 diff --git a/uncompyle6/semantics/transform.py b/uncompyle6/semantics/transform.py index 6c1ea11b..3504a206 100644 --- a/uncompyle6/semantics/transform.py +++ b/uncompyle6/semantics/transform.py @@ -132,7 +132,7 @@ class TreeTransform(GenericASTTraversal, object): if stmts in ("c_stmts", "stmts", "stmts_opt") and len(stmts) == 1: raise_stmt = stmts[0] - if raise_stmt != "raise_stmt1": + if raise_stmt != "raise_stmt1" and len(raise_stmt) > 0: raise_stmt = raise_stmt[0] testtrue_or_false = testexpr[0] @@ -147,17 +147,15 @@ class TreeTransform(GenericASTTraversal, object): assert_expr = testtrue_or_false[0] jump_cond = NoneToken else: - try: - assert testtrue_or_false in ("testfalse", "testfalsel") - except: - from trepan.api import debug; debug() + assert testtrue_or_false in ("testfalse", "testfalsel") assert_expr = testtrue_or_false[0] - if assert_expr == "testfalse_not_and": - # FIXME: come pack to stuff like this + if assert_expr in ("testfalse_not_and", "and_not"): + # FIXME: come back to stuff like this return node jump_cond = testtrue_or_false[1] assert_expr.kind = "assert_expr" + pass expr = raise_stmt[0] RAISE_VARARGS_1 = raise_stmt[1] @@ -257,6 +255,7 @@ class TreeTransform(GenericASTTraversal, object): where appropriate. """ + else_suite = node[3] n = else_suite[0]