Add 3.3 bytecode testing..

Also, correct ifelse detection in 3.3
This commit is contained in:
rocky
2024-03-02 07:01:40 -05:00
parent c591f4e6e6
commit d2d4367dae
2 changed files with 16 additions and 15 deletions

View File

@@ -115,7 +115,7 @@ check-bytecode-2:
# FIXME: Until we shaked out problems with xdis... # FIXME: Until we shaked out problems with xdis...
check-bytecode-3: check-bytecode-3:
$(PYTHON) test_pythonlib.py \ $(PYTHON) test_pythonlib.py \
--bytecode-3.4 --bytecode-3.5 --bytecode-3.6 \ --bytecode-3.3 --bytecode-3.4 --bytecode-3.5 --bytecode-3.6 \
--bytecode-3.7 --bytecode-3.8 --bytecode-3.7 --bytecode-3.8
#: Check deparsing on selected bytecode 3.x #: Check deparsing on selected bytecode 3.x

View File

@@ -311,21 +311,22 @@ class TreeTransform(GenericASTTraversal, object):
n = n[0][0] n = n[0][0]
elif len_n == 0: elif len_n == 0:
return node return node
elif n[0].kind in ("lastc_stmt", "lastl_stmt"):
if n[0].kind in ("lastc_stmt", "lastl_stmt"):
n = n[0] n = n[0]
if n[0].kind in (
"ifstmt", if n[0].kind in (
"iflaststmt", "ifstmt",
"iflaststmtl", "iflaststmt",
"ifelsestmtl", "iflaststmtl",
"ifelsestmtc", "ifelsestmtl",
"ifpoplaststmtl", "ifelsestmtc",
): "ifpoplaststmtl",
n = n[0] ):
if n.kind == "ifpoplaststmtl": n = n[0]
old_stmts = n[2] if n.kind == "ifpoplaststmtl":
else_suite_index = 2 old_stmts = n[2]
pass else_suite_index = 2
pass pass
else: else:
if ( if (