You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Towards fixing a Python 3.3 return/continue bug
This commit is contained in:
@@ -322,10 +322,12 @@ class Scanner3(Scanner):
|
|||||||
if target <= inst.offset:
|
if target <= inst.offset:
|
||||||
next_opname = self.opname[self.code[inst.offset+3]]
|
next_opname = self.opname[self.code[inst.offset+3]]
|
||||||
if (inst.offset in self.stmts and
|
if (inst.offset in self.stmts and
|
||||||
next_opname not in ('END_FINALLY', 'POP_BLOCK',
|
(next_opname not in ('END_FINALLY', 'POP_BLOCK',
|
||||||
# Python 3.0 only uses POP_TOP
|
# Python 3.0 only uses POP_TOP
|
||||||
'POP_TOP')
|
'POP_TOP')
|
||||||
and inst.offset not in self.not_continue):
|
and inst.offset not in self.not_continue) or
|
||||||
|
(tokens[-1].type == 'RETURN_VALUE' and
|
||||||
|
self.version < 3.5)):
|
||||||
opname = 'CONTINUE'
|
opname = 'CONTINUE'
|
||||||
else:
|
else:
|
||||||
opname = 'JUMP_BACK'
|
opname = 'JUMP_BACK'
|
||||||
|
Reference in New Issue
Block a user