From c22528df06e821936590431db5ba1a424e16f6a0 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Wed, 16 Oct 2013 22:51:16 +0200 Subject: Replace print statement by print function. --- debug_toolbar/management/commands/debugsqlshell.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'debug_toolbar/management') diff --git a/debug_toolbar/management/commands/debugsqlshell.py b/debug_toolbar/management/commands/debugsqlshell.py index e96f46d..45a23c2 100644 --- a/debug_toolbar/management/commands/debugsqlshell.py +++ b/debug_toolbar/management/commands/debugsqlshell.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from datetime import datetime from django.db.backends import util @@ -14,9 +16,9 @@ class PrintQueryWrapper(util.CursorDebugWrapper): return self.cursor.execute(sql, params) finally: raw_sql = self.db.ops.last_executed_query(self.cursor, sql, params) - execution_time = datetime.now() - starttime - print sqlparse.format(raw_sql, reindent=True), - print ' [%.2fms]' % (ms_from_timedelta(execution_time),) - print + execution_time = ms_from_timedelta(datetime.now() - starttime) + formatted_sql = sqlparse.format(raw_sql, reindent=True) + print('%s [%.2fms]' % (formatted_sql, execution_time)) + util.CursorDebugWrapper = PrintQueryWrapper -- cgit v1.2.3