From fe6b2ce8c3db95367741012dce6a310cdd50266e Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Wed, 8 Jan 2014 21:55:17 +0100 Subject: Allow the tests to run on Django 1.7. --- debug_toolbar/management/commands/debugsqlshell.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'debug_toolbar/management/commands/debugsqlshell.py') 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 -- cgit v1.2.3