Skip to content

Commit

Permalink
add support for python 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
dror committed Apr 20, 2016
1 parent a37e4a3 commit 02ba335
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: python

python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
Expand Down
11 changes: 8 additions & 3 deletions overrides/overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
__VERSION__ = '0.5'


if sys.version > '3':
if sys.version < '3':
def itemint(x):
return ord(x)
else:
def itemint(x):
return x
long = int


Expand Down Expand Up @@ -74,10 +79,10 @@ def _get_base_class_names(frame):
extends = []
while i <= lasti:
c = code[i]
op = c
op = itemint(c)
i += 1
if op >= dis.HAVE_ARGUMENT:
oparg = code[i] + code[i+1]*256 + extended_arg
oparg = itemint(code[i]) + itemint(code[i+1])*256 + extended_arg
extended_arg = 0
i += 2
if op == dis.EXTENDED_ARG:
Expand Down

0 comments on commit 02ba335

Please sign in to comment.