File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ __version__ = '1.0.0'
1717import sys
1818IS_PY2 = sys.version[0 ] == ' 2'
1919
20+ try :
21+ from collections import OrderedDict
22+ except ImportError :
23+ from ordereddict import OrderedDict
24+
2025if IS_PY2:
2126 END_CHAR = ' e'
2227else :
@@ -57,7 +62,7 @@ def decode_list(bytes x, int f):
5762
5863
5964def decode_dict (bytes x , int f ):
60- r, f = {} , f + 1
65+ r, f = OrderedDict() , f + 1
6166 while x[f] != END_CHAR:
6267 k, f = decode_string(x, f)
6368 r[k], f = decode_func[x[f]](x, f)
Original file line number Diff line number Diff line change 1- import sys
1+ import platform
22
33from setuptools import setup
44from setuptools .extension import Extension
55
6+ version = platform .python_version_tuple ()
7+ install_requires = []
8+ if version < ('2' , '7' ):
9+ install_requires .append ('ordereddict>=1.1' )
10+
611setup (
712 name = 'bencoder.pyx' ,
813 version = '1.0.0' ,
3540 'Topic :: Software Development :: Libraries :: Python Modules' ,
3641 ],
3742 ext_modules = [Extension ('bencoder' , ['bencoder.c' ])],
43+ install_requires = install_requires ,
3844 tests_require = ['nose' ],
3945 test_suite = 'nose.collector' ,
4046)
You can’t perform that action at this time.
0 commit comments