Python 2.2 doesn't have opcode LIST_APPEND

This commit is contained in:
rocky
2016-08-16 12:45:43 -04:00
parent 98a6f47ad6
commit 31413be7a1
3 changed files with 26 additions and 1 deletions

View File

@@ -381,7 +381,8 @@ class Scanner2(scan.Scanner):
j = self.prev[s]
while code[j] == self.opc.JUMP_ABSOLUTE:
j = self.prev[j]
if code[j] == self.opc.LIST_APPEND: # list comprehension
if (self.version >= 2.3 and
code[j] == self.opc.LIST_APPEND): # list comprehension
stmts.remove(s)
continue
elif code[s] == self.opc.POP_TOP and code[self.prev[s]] == self.opc.ROT_TWO: