Get ready for release 2.9.0 ...

- Use xdis 3.0.0 protocol load_module. Needs bump in requirements.txt
  and _pkg_info_.py
- Start Python 1.5 decompiling - another round of work is needed to remove
  bugs
- small cleanups
This commit is contained in:
rocky
2016-10-10 09:28:07 -04:00
parent e888a87d15
commit 8b240a80e7
13 changed files with 76 additions and 44 deletions

View File

@@ -410,7 +410,7 @@ class Scanner2(scan.Scanner):
j = self.prev[s]
while code[j] in self.designator_ops:
j = self.prev[j]
if code[j] == self.opc.FOR_ITER:
if self.version >= 2.1 and code[j] == self.opc.FOR_ITER:
stmts.remove(s)
continue
last_stmt = s
@@ -564,7 +564,8 @@ class Scanner2(scan.Scanner):
target = self.get_target(jump_back, self.opc.JUMP_ABSOLUTE)
if code[target] in (self.opc.FOR_ITER, self.opc.GET_ITER):
if (self.version >= 2.0 and
code[target] in (self.opc.FOR_ITER, self.opc.GET_ITER)):
loop_type = 'for'
else:
loop_type = 'while'
@@ -837,7 +838,8 @@ class Scanner2(scan.Scanner):
oparg = self.get_argument(offset)
if label is None:
if op in self.opc.hasjrel and op != self.opc.FOR_ITER:
if (op in self.opc.hasjrel and
(self.version < 2.0 or op != self.opc.FOR_ITER)):
label = offset + 3 + oparg
elif self.version == 2.7 and op in self.opc.hasjabs:
if op in (self.opc.JUMP_IF_FALSE_OR_POP,