Skip to content

Commit

Permalink
Remove workaround for Python 2.6 wrt OrderedDict
Browse files Browse the repository at this point in the history
collections.OrderedDict was added to Python starting with 2.7. As
django-import-export only supports Python 2.7+ or Python 3.3+, can
safely rely on the stdlib version of OrderedDict.
  • Loading branch information
jdufresne committed Nov 24, 2017
1 parent 688034a commit 038cae6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
6 changes: 1 addition & 5 deletions import_export/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import functools
import tablib
import traceback
from collections import OrderedDict
from copy import deepcopy

from diff_match_patch import diff_match_patch
Expand Down Expand Up @@ -41,11 +42,6 @@
except ImportError:
from django.utils.encoding import force_unicode as force_text

try:
from collections import OrderedDict
except ImportError:
from django.utils.datastructures import SortedDict as OrderedDict

# Set default logging handler to avoid "No handler found" warnings.
import logging # isort:skip
try: # Python 2.7+
Expand Down
5 changes: 1 addition & 4 deletions import_export/results.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
from __future__ import unicode_literals

try:
from collections import OrderedDict
except ImportError:
from django.utils.datastructures import SortedDict as OrderedDict
from collections import OrderedDict

from tablib import Dataset

Expand Down

0 comments on commit 038cae6

Please sign in to comment.