diff options
| author | Jannis Leidel | 2013-12-09 18:58:15 +0100 |
|---|---|---|
| committer | Jannis Leidel | 2013-12-09 18:58:15 +0100 |
| commit | 810a2fbc5157f619eb3d74c73c882f059360506b (patch) | |
| tree | cce2010fe85ddbc9f388115d94267a6e709630fd /debug_toolbar/panels/staticfiles.py | |
| parent | e4fafb92377221201f9089aa972ac6c5504b45dd (diff) | |
| download | django-debug-toolbar-810a2fbc5157f619eb3d74c73c882f059360506b.tar.bz2 | |
Use collections.OrderedDict if available.
Diffstat (limited to 'debug_toolbar/panels/staticfiles.py')
| -rw-r--r-- | debug_toolbar/panels/staticfiles.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/debug_toolbar/panels/staticfiles.py b/debug_toolbar/panels/staticfiles.py index 4ccac71..94bc35a 100644 --- a/debug_toolbar/panels/staticfiles.py +++ b/debug_toolbar/panels/staticfiles.py @@ -12,8 +12,11 @@ from django.contrib.staticfiles import finders, storage from django.contrib.staticfiles.templatetags import staticfiles from django.utils.translation import ungettext, ugettext_lazy as _ -from django.utils.datastructures import SortedDict from django.utils.functional import LazyObject +try: + from collections import OrderedDict +except ImportError: + from django.utils.datastructures import SortedDict as OrderedDict from debug_toolbar import panels from debug_toolbar.utils import ThreadCollector @@ -132,7 +135,7 @@ class StaticFilesPanel(panels.Panel): of relative and file system paths which that finder was able to find. """ - finders_mapping = SortedDict() + finders_mapping = OrderedDict() for finder in finders.get_finders(): for path, finder_storage in finder.list([]): if getattr(finder_storage, 'prefix', None): |
