Try to import Python's OrderedDict
There is an OrderedDict in Python 2.7+. The try order is now as follows: * OrderedDict from Python's collections module * OrderedDict from the jsonencode module (dependency) * OrderedDict from the ordereddict module (pypi package) * our own OrderedDict
This commit is contained in:
parent
203d540163
commit
5ac2de43d7
1 changed files with 111 additions and 105 deletions
|
|
@ -18,9 +18,15 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
from collections import OrderedDict
|
||||||
|
except ImportError:
|
||||||
|
try:
|
||||||
|
from simplejson import OrderedDict
|
||||||
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
from ordereddict import OrderedDict
|
from ordereddict import OrderedDict
|
||||||
except:
|
except ImportError:
|
||||||
## {{{ http://code.activestate.com/recipes/576693/ (r6)
|
## {{{ http://code.activestate.com/recipes/576693/ (r6)
|
||||||
from UserDict import DictMixin
|
from UserDict import DictMixin
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue