Skip to content

Commit 2e62d29

Browse files
committed
Fix small python 2.6 compability issues.
1 parent f16bbbf commit 2e62d29

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

sc2reader/data/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
import json
44
import pkgutil
5-
from collections import OrderedDict
5+
6+
try:
7+
from collections import OrderedDict
8+
except ImportError as e:
9+
from ordereddict import OrderedDict
10+
611
from sc2reader.log_utils import loggable
712

813
ABIL_LOOKUP = dict()

sc2reader/decoders.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55

66
import struct
77
import functools
8-
from collections import OrderedDict
8+
9+
try:
10+
from collections import OrderedDict
11+
except ImportError as e:
12+
from ordereddict import OrderedDict
913

1014
class ByteDecoder(object):
1115
"""

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
]
4646
},
4747

48-
install_requires=['mpyq>=0.2.2','argparse'] if float(sys.version[:3]) < 2.7 else ['mpyq>=0.2.2'],
48+
install_requires=['mpyq>=0.2.2','argparse','ordereddict'] if float(sys.version[:3]) < 2.7 else ['mpyq>=0.2.2'],
4949
packages=setuptools.find_packages(),
5050
include_package_data=True,
5151
zip_safe=True

0 commit comments

Comments
 (0)