Skip to content

Commit 48a825a

Browse files
committed
From pformat() to saferepr()
Refs #1076
1 parent 9f4c106 commit 48a825a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

debug_toolbar/panels/sql/panel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import uuid
44
from collections import defaultdict
55
from copy import copy
6-
from pprint import pformat
6+
from pprint import saferepr
77

88
from django.conf.urls import url
99
from django.db import connections
@@ -151,10 +151,10 @@ def similar_key(query):
151151

152152
def duplicate_key(query):
153153
raw_params = () if query['raw_params'] is None else tuple(query['raw_params'])
154-
# pformat() avoids problems because of unhashable types
154+
# saferepr() avoids problems because of unhashable types
155155
# (e.g. lists) when used as dictionary keys.
156156
# https://github.com/jazzband/django-debug-toolbar/issues/1091
157-
return (query['raw_sql'], pformat(raw_params))
157+
return (query['raw_sql'], saferepr(raw_params))
158158

159159
if self._queries:
160160
width_ratio_tally = 0

0 commit comments

Comments
 (0)