Better "assert" transformation. More 3.8 tests

This commit is contained in:
rocky
2019-12-10 10:39:43 -05:00
parent 3e3dd87c3b
commit 79c38441b5
4 changed files with 7 additions and 3 deletions

View File

@@ -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