Skip to content

Commit d2d4367

Browse files
committed
Add 3.3 bytecode testing..
Also, correct ifelse detection in 3.3
1 parent c591f4e commit d2d4367

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

test/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ check-bytecode-2:
115115
# FIXME: Until we shaked out problems with xdis...
116116
check-bytecode-3:
117117
$(PYTHON) test_pythonlib.py \
118-
--bytecode-3.4 --bytecode-3.5 --bytecode-3.6 \
118+
--bytecode-3.3 --bytecode-3.4 --bytecode-3.5 --bytecode-3.6 \
119119
--bytecode-3.7 --bytecode-3.8
120120

121121
#: Check deparsing on selected bytecode 3.x

uncompyle6/semantics/transform.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -311,21 +311,22 @@ def n_ifelsestmt(self, node, preprocess=False):
311311
n = n[0][0]
312312
elif len_n == 0:
313313
return node
314-
elif n[0].kind in ("lastc_stmt", "lastl_stmt"):
314+
315+
if n[0].kind in ("lastc_stmt", "lastl_stmt"):
315316
n = n[0]
316-
if n[0].kind in (
317-
"ifstmt",
318-
"iflaststmt",
319-
"iflaststmtl",
320-
"ifelsestmtl",
321-
"ifelsestmtc",
322-
"ifpoplaststmtl",
323-
):
324-
n = n[0]
325-
if n.kind == "ifpoplaststmtl":
326-
old_stmts = n[2]
327-
else_suite_index = 2
328-
pass
317+
318+
if n[0].kind in (
319+
"ifstmt",
320+
"iflaststmt",
321+
"iflaststmtl",
322+
"ifelsestmtl",
323+
"ifelsestmtc",
324+
"ifpoplaststmtl",
325+
):
326+
n = n[0]
327+
if n.kind == "ifpoplaststmtl":
328+
old_stmts = n[2]
329+
else_suite_index = 2
329330
pass
330331
else:
331332
if (

0 commit comments

Comments
 (0)