You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 16:59:52 +08:00
while1 rule adjustment for 3.0
This commit is contained in:
@@ -1542,12 +1542,24 @@ class Python3Parser(PythonParser):
|
||||
for i in range(cfl - 1, first, -1):
|
||||
if tokens[i] != "POP_BLOCK":
|
||||
break
|
||||
if tokens[i].kind not in ("JUMP_BACK", "RETURN_VALUE"):
|
||||
if tokens[i].kind not in ("JUMP_BACK", "RETURN_VALUE", "BREAK_LOOP"):
|
||||
if not tokens[i].kind.startswith("COME_FROM"):
|
||||
return True
|
||||
|
||||
# Check that the SETUP_LOOP jumps to the offset after the
|
||||
# COME_FROM_LOOP
|
||||
|
||||
# Python 3.0 has additional:
|
||||
# JUMP_FORWARD here
|
||||
# COME_FROM
|
||||
# POP_TOP
|
||||
# COME_FROM
|
||||
# here:
|
||||
# (target of SETUP_LOOP)
|
||||
# We won't check this.
|
||||
if self.version == 3.0:
|
||||
return False
|
||||
|
||||
if 0 <= last < len(tokens) and tokens[last] in (
|
||||
"COME_FROM_LOOP",
|
||||
"JUMP_BACK",
|
||||
|
Reference in New Issue
Block a user