From 313a8578b3b03828a67d403529bbd82fa33bf39b Mon Sep 17 00:00:00 2001 From: rocky Date: Tue, 29 Dec 2015 22:23:50 -0500 Subject: [PATCH] Fix another cross-version bug: eliminate version-specific library 'dis' and use corresponding version-indepent routine instead. --- uncompyle6/scanners/scanner3.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/uncompyle6/scanners/scanner3.py b/uncompyle6/scanners/scanner3.py index be0fd76f..fcbd418c 100644 --- a/uncompyle6/scanners/scanner3.py +++ b/uncompyle6/scanners/scanner3.py @@ -316,14 +316,14 @@ class Scanner3(scan.Scanner): # Determine structures and fix jumps for 2.3+ self.detect_structure(offset) - if op >= dis.HAVE_ARGUMENT: + if op >= op3.HAVE_ARGUMENT: label = self.fixed_jumps.get(offset) oparg = code[offset+1] + code[offset+2] * 256 if label is None: - if op in dis.hasjrel and op != FOR_ITER: + if op in op3.hasjrel and op != FOR_ITER: label = offset + 3 + oparg - elif op in dis.hasjabs: + elif op in op3.hasjabs: if op in (JUMP_IF_FALSE_OR_POP, JUMP_IF_TRUE_OR_POP): if oparg > offset: label = oparg @@ -439,7 +439,7 @@ class Scanner3(scan.Scanner): """ op = self.code[offset] target = self.code[offset+1] + self.code[offset+2] * 256 - if op in dis.hasjrel: + if op in op3.hasjrel: target += offset + 3 return target