aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAymeric Augustin2013-10-16 22:51:16 +0200
committerAymeric Augustin2013-10-17 18:24:57 +0200
commitc22528df06e821936590431db5ba1a424e16f6a0 (patch)
treec377cd715bd4cd32bb829b9fef46ded84631c1df
parent820161dea57316e177f0bf05741fd510f53df5d3 (diff)
downloaddjango-debug-toolbar-c22528df06e821936590431db5ba1a424e16f6a0.tar.bz2
Replace print statement by print function.
-rw-r--r--debug_toolbar/management/commands/debugsqlshell.py10
1 files changed, 6 insertions, 4 deletions
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