From 36b75215979cd3f88bf338c0fb8f4580fba62f44 Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 24 Jun 2016 09:47:45 -0400 Subject: [PATCH] Small formating changes ... and premonition of 2.6 byteocde work --- uncompyle6/scanners/scanner2.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/uncompyle6/scanners/scanner2.py b/uncompyle6/scanners/scanner2.py index 1aebeb06..dbadda3f 100755 --- a/uncompyle6/scanners/scanner2.py +++ b/uncompyle6/scanners/scanner2.py @@ -184,8 +184,10 @@ class Scanner2(scan.Scanner): elif op == self.opc.JA: target = self.get_target(offset) if target < offset: - if offset in self.stmts and self.code[offset+3] not in (self.opc.END_FINALLY, self.opc.POP_BLOCK) \ - and offset not in self.not_continue: + if (offset in self.stmts + and self.code[offset+3] not in (self.opc.END_FINALLY, + self.opc.POP_BLOCK) + and offset not in self.not_continue): opname = 'CONTINUE' else: opname = 'JUMP_BACK' @@ -366,7 +368,9 @@ class Scanner2(scan.Scanner): op = self.code[i] if op == self.opc.END_FINALLY: if count_END_FINALLY == count_SETUP_: - assert self.code[self.prev[i]] in (self.opc.JA, self.opc.JF, self.opc.RETURN_VALUE) + if self.version == 2.7: + assert self.code[self.prev[i]] in \ + self.jump_forward | {self.opc.RETURN_VALUE} self.not_continue.add(self.prev[i]) return self.prev[i] count_END_FINALLY += 1