From 3bbbae731f1ab98c218dfaf29aed05b69329c4c5 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Fri, 22 Nov 2013 17:52:56 +0100 Subject: Fix regression introduced in 87a7375. Fix #466. --- debug_toolbar/panels/profiling.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'debug_toolbar') 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: -- cgit v1.2.3