Skip to content

Commit 9a68777

Browse files
authored
Merge pull request #33 from cclauss/patch-2
Define cmp() for Python 3
2 parents c0beb4e + 99e633f commit 9a68777

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sc2reader/data/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111

1212
from sc2reader.log_utils import loggable
1313

14+
try:
15+
cmp # Python 2
16+
except NameError:
17+
cmp = lambda a, b: (a > b) - (a < b) # noqa Python 3
18+
1419
ABIL_LOOKUP = dict()
1520
for entry in pkgutil.get_data('sc2reader.data', 'ability_lookup.csv').decode('utf8').split('\n'):
1621
if not entry:

0 commit comments

Comments
 (0)