You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
ifstmt reduction vs extended_args
This commit is contained in:
@@ -46,13 +46,12 @@ def ifstmt(self, lhs, n, rule, ast, tokens, first, last):
|
|||||||
if testexpr[0] in ("testtrue", "testfalse"):
|
if testexpr[0] in ("testtrue", "testfalse"):
|
||||||
test = testexpr[0]
|
test = testexpr[0]
|
||||||
if len(test) > 1 and test[1].kind.startswith("jmp_"):
|
if len(test) > 1 and test[1].kind.startswith("jmp_"):
|
||||||
if last == n:
|
last = min(last, n-1)
|
||||||
last -= 1
|
|
||||||
jmp_target = test[1][0].attr
|
jmp_target = test[1][0].attr
|
||||||
if (
|
if (
|
||||||
tokens[first].off2int()
|
tokens[first].off2int(True)
|
||||||
<= jmp_target
|
<= jmp_target
|
||||||
< tokens[last].off2int()
|
< tokens[last].off2int(False)
|
||||||
):
|
):
|
||||||
return True
|
return True
|
||||||
# jmp_target less than tokens[first] is okay - is to a loop
|
# jmp_target less than tokens[first] is okay - is to a loop
|
||||||
|
Reference in New Issue
Block a user