aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/toolbar.py
diff options
context:
space:
mode:
authorAymeric Augustin2013-12-15 14:54:36 +0100
committerAymeric Augustin2013-12-15 14:54:36 +0100
commitba5af8f6fe7836eef0a0c85dd1e6d7418bc87f75 (patch)
tree7528a754a8e49fb7786eeb62f4690640c77e7cb9 /debug_toolbar/toolbar.py
parent38de94d2d6586c716256838e41abe518898030d6 (diff)
downloaddjango-debug-toolbar-ba5af8f6fe7836eef0a0c85dd1e6d7418bc87f75.tar.bz2
Fix #499 - Regression from 810a2fbc.
Diffstat (limited to 'debug_toolbar/toolbar.py')
-rw-r--r--debug_toolbar/toolbar.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/debug_toolbar/toolbar.py b/debug_toolbar/toolbar.py
index ec840dd..53b3182 100644
--- a/debug_toolbar/toolbar.py
+++ b/debug_toolbar/toolbar.py
@@ -89,9 +89,12 @@ class DebugToolbar(object):
cls = type(self)
cls._store[self.store_id] = self
for _ in range(len(cls._store) - self.config['RESULTS_STORE_SIZE']):
- # When we drop support for Python 2.6 and switch to
- # collections.OrderedDict, use popitem(last=False).
- del cls._store[cls._store.keyOrder[0]]
+ try:
+ # collections.OrderedDict
+ cls._store.popitem(last=False)
+ except TypeError:
+ # django.utils.datastructures.SortedDict
+ del cls._store[cls._store.keyOrder[0]]
@classmethod
def fetch(cls, store_id):