File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -56,9 +56,15 @@ def render_stacktrace(trace):
56
56
stacktrace = []
57
57
for frame in trace :
58
58
params = map (escape , frame [0 ].rsplit (os .path .sep , 1 ) + list (frame [1 :]))
59
+ params_dict = dict ((unicode (idx ), v ) for idx , v in enumerate (params ))
59
60
try :
60
- stacktrace .append (u'<span class="path">{0}/</span><span class="file">{1}</span> in <span class="func">{3}</span>(<span class="lineno">{2}</span>)\n <span class="code">{4}</span>' .format (* params ))
61
- except IndexError :
61
+ stacktrace .append (u'<span class="path">%(0)s/</span>'
62
+ u'<span class="file">%(1)s</span>'
63
+ u' in <span class="func">%(3)s</span>'
64
+ u'(<span class="lineno">%(2)s</span>)\n '
65
+ u' <span class="code">%(4)s</span>'
66
+ % params_dict )
67
+ except KeyError :
62
68
# This frame doesn't have the expected format, so skip it and move on to the next one
63
69
continue
64
70
return mark_safe ('\n ' .join (stacktrace ))
Original file line number Diff line number Diff line change
1
+ from __future__ import with_statement
1
2
import thread
2
3
3
4
from django .conf import settings
You can’t perform that action at this time.
0 commit comments