aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/management/commands/debugsqlshell.py
diff options
context:
space:
mode:
Diffstat (limited to 'debug_toolbar/management/commands/debugsqlshell.py')
-rw-r--r--debug_toolbar/management/commands/debugsqlshell.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/debug_toolbar/management/commands/debugsqlshell.py b/debug_toolbar/management/commands/debugsqlshell.py
index 2d4bfa6..7e1471f 100644
--- a/debug_toolbar/management/commands/debugsqlshell.py
+++ b/debug_toolbar/management/commands/debugsqlshell.py
@@ -4,12 +4,15 @@ from time import time
# 'debugsqlshell' is the same as the 'shell'.
from django.core.management.commands.shell import Command # noqa
-from django.db.backends import util
+try:
+ from django.db.backends import utils
+except ImportError:
+ from django.db.backends import util as utils
import sqlparse
-class PrintQueryWrapper(util.CursorDebugWrapper):
+class PrintQueryWrapper(utils.CursorDebugWrapper):
def execute(self, sql, params=()):
start_time = time()
try:
@@ -22,4 +25,4 @@ class PrintQueryWrapper(util.CursorDebugWrapper):
print('%s [%.2fms]' % (formatted_sql, duration))
-util.CursorDebugWrapper = PrintQueryWrapper
+utils.CursorDebugWrapper = PrintQueryWrapper