You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 16:59:52 +08:00
Better "assert" transformation. More 3.8 tests
This commit is contained in:
BIN
test/bytecode_3.8/03_pop_top.pyc
Normal file
BIN
test/bytecode_3.8/03_pop_top.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_3.8_run/04_and_del.pyc
Normal file
BIN
test/bytecode_3.8_run/04_and_del.pyc
Normal file
Binary file not shown.
@@ -1,5 +1,7 @@
|
|||||||
# From 2.5.6 osxemxpath.py
|
# From 2.5.6 osxemxpath.py
|
||||||
# Bug is in getting "and" and "del" correct
|
# Bug is in getting "and" and "del" correct
|
||||||
|
|
||||||
|
# This is RUNNABLE!
|
||||||
def normpath(comps):
|
def normpath(comps):
|
||||||
i = 0
|
i = 0
|
||||||
while i < len(comps):
|
while i < len(comps):
|
||||||
|
@@ -75,9 +75,11 @@ class TreeTransform(GenericASTTraversal, object):
|
|||||||
|
|
||||||
if testexpr.kind != "testexpr":
|
if testexpr.kind != "testexpr":
|
||||||
return node
|
return node
|
||||||
if node.kind == "ifstmt":
|
if node.kind in ("ifstmt", "ifstmtl"):
|
||||||
ifstmts_jump = node[1]
|
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
|
return node
|
||||||
stmts = ifstmts_jump[0]
|
stmts = ifstmts_jump[0]
|
||||||
else:
|
else:
|
||||||
@@ -156,7 +158,7 @@ class TreeTransform(GenericASTTraversal, object):
|
|||||||
pass
|
pass
|
||||||
return node
|
return node
|
||||||
|
|
||||||
n_iflaststmtl = n_ifstmt
|
n_ifstmtl = n_iflaststmtl = n_ifstmt
|
||||||
|
|
||||||
# preprocess is used for handling chains of
|
# preprocess is used for handling chains of
|
||||||
# if elif elif
|
# if elif elif
|
||||||
|
Reference in New Issue
Block a user