aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/panels
diff options
context:
space:
mode:
authorAymeric Augustin2013-11-22 17:52:56 +0100
committerAymeric Augustin2013-11-22 17:52:56 +0100
commit3bbbae731f1ab98c218dfaf29aed05b69329c4c5 (patch)
tree9edd50934b4562292e2c1d0aa7ab0a3df5f594b8 /debug_toolbar/panels
parente4d2e2b7b253be1690d54e3842f4c7a2a2ccc549 (diff)
downloaddjango-debug-toolbar-3bbbae731f1ab98c218dfaf29aed05b69329c4c5.tar.bz2
Fix regression introduced in 87a7375.
Fix #466.
Diffstat (limited to 'debug_toolbar/panels')
-rw-r--r--debug_toolbar/panels/profiling.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/debug_toolbar/panels/profiling.py b/debug_toolbar/panels/profiling.py
index 397069f..6192ef9 100644
--- a/debug_toolbar/panels/profiling.py
+++ b/debug_toolbar/panels/profiling.py
@@ -131,7 +131,7 @@ class FunctionCall(object):
if self._line_stats_text is None and DJ_PROFILE_USE_LINE_PROFILER:
lstats = self.statobj.line_stats
if self.func in lstats.timings:
- out = cStringIO.StringIO()
+ out = cStringIO()
fn, lineno, name = self.func
show_func(fn, lineno, name, lstats.timings[self.func], lstats.unit, stream=out)
self._line_stats_text = out.getvalue()
@@ -142,7 +142,7 @@ class FunctionCall(object):
class ProfilingDebugPanel(DebugPanel):
"""
- Panel that displays the Django version.
+ Panel that displays profiling information.
"""
name = 'Profiling'
template = 'debug_toolbar/panels/profiling.html'
@@ -191,6 +191,7 @@ class ProfilingDebugPanel(DebugPanel):
def process_response(self, request, response):
if not hasattr(self, 'profiler'):
return None
+ # Could be delayed until the panel content is requested (perf. optim.)
self.profiler.create_stats()
self.stats = DjangoDebugToolbarStats(self.profiler)
if DJ_PROFILE_USE_LINE_PROFILER: