diff options
| author | Aymeric Augustin | 2013-10-16 23:03:07 +0200 |
|---|---|---|
| committer | Aymeric Augustin | 2013-10-17 18:24:58 +0200 |
| commit | 23c44d8c5cf560cc8cb304d8753e8b658d1fe70d (patch) | |
| tree | 575ad8a220c70a8f00a3d6fdab49f29d062d10be /debug_toolbar/utils/__init__.py | |
| parent | c22528df06e821936590431db5ba1a424e16f6a0 (diff) | |
| download | django-debug-toolbar-23c44d8c5cf560cc8cb304d8753e8b658d1fe70d.tar.bz2 | |
Enable unicode_literals in all non-empty modules.
Diffstat (limited to 'debug_toolbar/utils/__init__.py')
| -rw-r--r-- | debug_toolbar/utils/__init__.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/debug_toolbar/utils/__init__.py b/debug_toolbar/utils/__init__.py index b8bb4a1..fa8c78a 100644 --- a/debug_toolbar/utils/__init__.py +++ b/debug_toolbar/utils/__init__.py @@ -1,3 +1,5 @@ +from __future__ import unicode_literals + import inspect import os.path import django @@ -58,11 +60,11 @@ def render_stacktrace(trace): params = map(escape, frame[0].rsplit(os.path.sep, 1) + list(frame[1:])) params_dict = dict((unicode(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 |
