Workaround for OrderedDict bug: import from 'ordereddict' backport module if available
This commit is contained in:
parent
54ca31f91b
commit
b993c64c48
@ -15,7 +15,12 @@ import threading, sys, copy, collections
|
||||
|
||||
try:
|
||||
from collections import OrderedDict
|
||||
except:
|
||||
except ImportError:
|
||||
# fallback: try to use the ordereddict backport when using python 2.6
|
||||
try:
|
||||
from ordereddict import OrderedDict
|
||||
except ImportError:
|
||||
# backport not installed: use local OrderedDict
|
||||
# Deprecated; this class is now present in Python 2.7 as collections.OrderedDict
|
||||
# Only keeping this around for python2.6 support.
|
||||
class OrderedDict(dict):
|
||||
|
Loading…
Reference in New Issue
Block a user