From 2327f0fdfaf79cec85cc108c8a179c7a366ce255 Mon Sep 17 00:00:00 2001 From: rocky Date: Sat, 31 Dec 2016 03:51:07 -0500 Subject: [PATCH] Towards fixing a Python 3.3 return/continue bug --- uncompyle6/scanners/scanner3.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/uncompyle6/scanners/scanner3.py b/uncompyle6/scanners/scanner3.py index ca7bbbb0..b3100c2c 100644 --- a/uncompyle6/scanners/scanner3.py +++ b/uncompyle6/scanners/scanner3.py @@ -322,10 +322,12 @@ class Scanner3(Scanner): if target <= inst.offset: next_opname = self.opname[self.code[inst.offset+3]] 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 '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' else: opname = 'JUMP_BACK'