Python 2.6 compatability via ericfrederich's patch. DRY version-checking code

This commit is contained in:
rocky
2015-12-17 20:48:54 -05:00
parent a309a77ea7
commit 2fc2d6c699
14 changed files with 72 additions and 56 deletions

View File

@@ -332,8 +332,8 @@ class Token(scanner.Token):
return 0
if JUMP_OPs and t in JUMP_OPs:
# ignore offset
return cmp(t, o.type)
return cmp(t, o.type) or cmp(self.pattr, o.pattr)
return t == o.type
return (t == o.type) or self.pattr == o.pattr
def __repr__(self):
return '%s %s (%s)' % (str(self.type), str(self.attr),