You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 08:49:51 +08:00
More 3.x "if" checking. Abbreviate stmts->sstmt
This commit is contained in:
@@ -20,11 +20,12 @@ def ifstmt(self, lhs, n, rule, ast, tokens, first, last):
|
||||
last_offset = tokens[l].offset
|
||||
for i in range(first, l):
|
||||
t = tokens[i]
|
||||
if t.kind == "POP_JUMP_IF_FALSE":
|
||||
# instead of POP_JUMP_IF, should we use op attributes?
|
||||
if t.kind in ("POP_JUMP_IF_FALSE", "POP_JUMP_IF_TRUE"):
|
||||
pjif_target = t.attr
|
||||
if pjif_target > last_offset:
|
||||
# In come cases, where we have long bytecode, a
|
||||
# "POP_JUMP_IF_FALSE" offset might be too
|
||||
# "POP_JUMP_IF_TRUE/FALSE" offset might be too
|
||||
# large for the instruction; so instead it
|
||||
# jumps to a JUMP_FORWARD. Allow that here.
|
||||
if tokens[l] == "JUMP_FORWARD":
|
||||
|
Reference in New Issue
Block a user