Python 3.5 continue detection bug

This commit is contained in:
rocky
2017-01-02 10:06:52 -05:00
parent 84c2932bc5
commit 2b46e71264
2 changed files with 9 additions and 5 deletions

View File

@@ -324,11 +324,12 @@ class Scanner3(Scanner):
if (inst.offset in self.stmts and
(next_opname not in ('END_FINALLY', 'POP_BLOCK',
# Python 3.0 only uses POP_TOP
'POP_TOP')
and inst.offset not in self.not_continue) or
(tokens[-1].type == 'RETURN_VALUE' and
self.version < 3.5)):
opname = 'CONTINUE'
'POP_TOP'))):
if (self.version == 3.5 or
(inst.offset not in self.not_continue) or
(tokens[-1].type == 'RETURN_VALUE')):
opname = 'CONTINUE'
pass
else:
opname = 'JUMP_BACK'
# FIXME: this is a hack to catch stuff like: