2to3; ordereddict fallback was for python2.6

master
pictuga 2015-03-03 00:57:09 +08:00
parent dbb3883516
commit 9bc5b0c7f7
1 changed files with 6 additions and 1 deletions

View File

@ -21,10 +21,15 @@ json.encoder.c_make_encoder = None
try:
from collections import OrderedDict
except ImportError:
# python < 2.7
from ordereddict import OrderedDict
try:
from StringIO import StringIO
from urllib2 import urlopen
except ImportError:
from ordereddict import OrderedDict
# python > 3
from io import StringIO
from urllib.request import urlopen