Skip to content

Commit

Permalink
Add 3.3 bytecode testing..
Browse files Browse the repository at this point in the history
Also, correct ifelse detection in 3.3
  • Loading branch information
rocky committed Mar 2, 2024
1 parent c591f4e commit d2d4367
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ check-bytecode-2:
# FIXME: Until we shaked out problems with xdis...
check-bytecode-3:
$(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

#: Check deparsing on selected bytecode 3.x
Expand Down
29 changes: 15 additions & 14 deletions uncompyle6/semantics/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,21 +311,22 @@ def n_ifelsestmt(self, node, preprocess=False):
n = n[0][0]
elif len_n == 0:
return node
elif n[0].kind in ("lastc_stmt", "lastl_stmt"):

if n[0].kind in ("lastc_stmt", "lastl_stmt"):
n = n[0]
if n[0].kind in (
"ifstmt",
"iflaststmt",
"iflaststmtl",
"ifelsestmtl",
"ifelsestmtc",
"ifpoplaststmtl",
):
n = n[0]
if n.kind == "ifpoplaststmtl":
old_stmts = n[2]
else_suite_index = 2
pass

if n[0].kind in (
"ifstmt",
"iflaststmt",
"iflaststmtl",
"ifelsestmtl",
"ifelsestmtc",
"ifpoplaststmtl",
):
n = n[0]
if n.kind == "ifpoplaststmtl":
old_stmts = n[2]
else_suite_index = 2
pass
else:
if (
Expand Down

0 comments on commit d2d4367

Please sign in to comment.