Skip to content

Commit

Permalink
remove u'' prefix, import __future__ unicode_lit..
Browse files Browse the repository at this point in the history
Remove u'' prefix, and import __future__ unicode_literals.
Now all strings without the u'' - are Unicode.


>>> from __future__ import unicode_literals
>>> hasattr(str, '__name__')
True
  • Loading branch information
w-diesel committed Apr 14, 2013
1 parent 76a8159 commit f5d4cde
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions debug_toolbar/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import unicode_literals
import inspect
import os.path
import django
Expand Down Expand Up @@ -62,11 +63,11 @@ def render_stacktrace(trace):
params = map(escape, frame[0].rsplit(os.path.sep, 1) + list(frame[1:]))
params_dict = dict((text_type(idx), v) for idx, v in enumerate(params))
try:
stacktrace.append(u'<span class="path">%(0)s/</span>'
u'<span class="file">%(1)s</span>'
u' in <span class="func">%(3)s</span>'
u'(<span class="lineno">%(2)s</span>)\n'
u' <span class="code">%(4)s</span>'
stacktrace.append('<span class="path">%(0)s/</span>'
'<span class="file">%(1)s</span>'
' in <span class="func">%(3)s</span>'
'(<span class="lineno">%(2)s</span>)\n'
' <span class="code">%(4)s</span>'
% params_dict)
except KeyError:
# This frame doesn't have the expected format, so skip it and move on to the next one
Expand Down

0 comments on commit f5d4cde

Please sign in to comment.