Python 2.1 doesn't have FOR_ITER or GET_ITER...

adjust locgic for this fact
This commit is contained in:
rocky
2017-01-15 09:50:38 -05:00
parent a01b8be054
commit 8dc23e2cdc

View File

@@ -427,7 +427,7 @@ class Scanner2(scan.Scanner):
j = self.prev[s]
while code[j] in self.designator_ops:
j = self.prev[j]
if self.version >= 2.1 and 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
@@ -589,7 +589,7 @@ class Scanner2(scan.Scanner):
target = self.get_target(jump_back, self.opc.JUMP_ABSOLUTE)
if (self.version >= 2.0 and
if (self.version > 2.1 and
code[target] in (self.opc.FOR_ITER, self.opc.GET_ITER)):
loop_type = 'for'
else: