diff options
| author | Vladislav Poluhin | 2013-04-24 15:54:17 +0800 |
|---|---|---|
| committer | Vladislav Poluhin | 2013-04-24 15:54:17 +0800 |
| commit | 4c1c4f7a8873a80f843ba683240b9d0ff0f49e4b (patch) | |
| tree | 4840de7ec2ec41d1ef7cc362803c2d0ace58d663 /debug_toolbar/utils/__init__.py | |
| parent | 3d0467d9a4394c4b994a802e6e861ff2562dbb2b (diff) | |
| parent | 6f79f0b0ada69e1d95d97066ba78e0d18aeab3ba (diff) | |
| download | django-debug-toolbar-4c1c4f7a8873a80f843ba683240b9d0ff0f49e4b.tar.bz2 | |
Merge branch 'master' of https://github.com/django-debug-toolbar/django-debug-toolbar into sql-panel-refactor
Conflicts:
debug_toolbar/static/debug_toolbar/css/toolbar.min.css
debug_toolbar/views.py
Diffstat (limited to 'debug_toolbar/utils/__init__.py')
| -rw-r--r-- | debug_toolbar/utils/__init__.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/debug_toolbar/utils/__init__.py b/debug_toolbar/utils/__init__.py index bfb485c..2d2ff10 100644 --- a/debug_toolbar/utils/__init__.py +++ b/debug_toolbar/utils/__init__.py @@ -56,9 +56,15 @@ def render_stacktrace(trace): stacktrace = [] for frame in 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}/</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)) - except IndexError: + 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>' + % params_dict) + except KeyError: # This frame doesn't have the expected format, so skip it and move on to the next one continue return mark_safe('\n'.join(stacktrace)) |
