aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/utils
diff options
context:
space:
mode:
authorRob Hudson2013-01-09 08:52:05 -0800
committerRob Hudson2013-01-09 08:52:05 -0800
commit3b284755fe9c2f9a714659f6f2e25a8eea1dd3df (patch)
treee73e04f256b634868bfeaefe036bd96e1c0e749c /debug_toolbar/utils
parent22ebebd29b5d42ae50e9681847784713fa67daf5 (diff)
parentd4971605cc0f82315805c44ea8346f609b1f07bb (diff)
downloaddjango-debug-toolbar-3b284755fe9c2f9a714659f6f2e25a8eea1dd3df.tar.bz2
Merge pull request #350 from charettes/simplejson
Use the built-in json module on python >= 2.6.
Diffstat (limited to 'debug_toolbar/utils')
-rw-r--r--debug_toolbar/utils/tracking/db.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/debug_toolbar/utils/tracking/db.py b/debug_toolbar/utils/tracking/db.py
index 0dc22a6..d898b31 100644
--- a/debug_toolbar/utils/tracking/db.py
+++ b/debug_toolbar/utils/tracking/db.py
@@ -5,7 +5,6 @@ from threading import local
from django.conf import settings
from django.template import Node
-from django.utils import simplejson
from django.utils.encoding import force_unicode, smart_str
from debug_toolbar.utils import ms_from_timedelta, tidy_stacktrace, \
@@ -13,8 +12,13 @@ from debug_toolbar.utils import ms_from_timedelta, tidy_stacktrace, \
from debug_toolbar.utils.compat.db import connections
try:
+ import json
+except ImportError: # python < 2.6
+ from django.utils import simplejson as json
+
+try:
from hashlib import sha1
-except ImportError:
+except ImportError: # python < 2.5
from django.utils.hashcompat import sha_constructor as sha1
# TODO:This should be set in the toolbar loader as a default and panels should
@@ -103,7 +107,7 @@ class NormalCursorWrapper(object):
stacktrace = []
_params = ''
try:
- _params = simplejson.dumps(
+ _params = json.dumps(
[force_unicode(x, strings_only=True) for x in params]
)
except TypeError: