You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 16:59:52 +08:00
transform ifelseif bugs
This commit is contained in:
@@ -135,6 +135,7 @@ SKIP_TESTS=(
|
|||||||
# 306 unit-test files in about 19 minutes
|
# 306 unit-test files in about 19 minutes
|
||||||
|
|
||||||
if (( batch )) ; then
|
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_dbm_gnu.py]=1 # fails on its own on POWER
|
||||||
SKIP_TESTS[test_distutils.py]=1
|
SKIP_TESTS[test_distutils.py]=1
|
||||||
SKIP_TESTS[test_fileio.py]=1
|
SKIP_TESTS[test_fileio.py]=1
|
||||||
|
@@ -132,7 +132,7 @@ class TreeTransform(GenericASTTraversal, object):
|
|||||||
|
|
||||||
if stmts in ("c_stmts", "stmts", "stmts_opt") and len(stmts) == 1:
|
if stmts in ("c_stmts", "stmts", "stmts_opt") and len(stmts) == 1:
|
||||||
raise_stmt = stmts[0]
|
raise_stmt = stmts[0]
|
||||||
if raise_stmt != "raise_stmt1":
|
if raise_stmt != "raise_stmt1" and len(raise_stmt) > 0:
|
||||||
raise_stmt = raise_stmt[0]
|
raise_stmt = raise_stmt[0]
|
||||||
|
|
||||||
testtrue_or_false = testexpr[0]
|
testtrue_or_false = testexpr[0]
|
||||||
@@ -147,17 +147,15 @@ class TreeTransform(GenericASTTraversal, object):
|
|||||||
assert_expr = testtrue_or_false[0]
|
assert_expr = testtrue_or_false[0]
|
||||||
jump_cond = NoneToken
|
jump_cond = NoneToken
|
||||||
else:
|
else:
|
||||||
try:
|
assert testtrue_or_false in ("testfalse", "testfalsel")
|
||||||
assert testtrue_or_false in ("testfalse", "testfalsel")
|
|
||||||
except:
|
|
||||||
from trepan.api import debug; debug()
|
|
||||||
assert_expr = testtrue_or_false[0]
|
assert_expr = testtrue_or_false[0]
|
||||||
if assert_expr == "testfalse_not_and":
|
if assert_expr in ("testfalse_not_and", "and_not"):
|
||||||
# FIXME: come pack to stuff like this
|
# FIXME: come back to stuff like this
|
||||||
return node
|
return node
|
||||||
|
|
||||||
jump_cond = testtrue_or_false[1]
|
jump_cond = testtrue_or_false[1]
|
||||||
assert_expr.kind = "assert_expr"
|
assert_expr.kind = "assert_expr"
|
||||||
|
pass
|
||||||
|
|
||||||
expr = raise_stmt[0]
|
expr = raise_stmt[0]
|
||||||
RAISE_VARARGS_1 = raise_stmt[1]
|
RAISE_VARARGS_1 = raise_stmt[1]
|
||||||
@@ -257,6 +255,7 @@ class TreeTransform(GenericASTTraversal, object):
|
|||||||
|
|
||||||
where appropriate.
|
where appropriate.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
else_suite = node[3]
|
else_suite = node[3]
|
||||||
|
|
||||||
n = else_suite[0]
|
n = else_suite[0]
|
||||||
|
Reference in New Issue
Block a user