Skip to content

Commit 3bbbae7

Browse files
committed
Fix regression introduced in 87a7375.
Fix #466.
1 parent e4d2e2b commit 3bbbae7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

debug_toolbar/panels/profiling.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def line_stats_text(self):
131131
if self._line_stats_text is None and DJ_PROFILE_USE_LINE_PROFILER:
132132
lstats = self.statobj.line_stats
133133
if self.func in lstats.timings:
134-
out = cStringIO.StringIO()
134+
out = cStringIO()
135135
fn, lineno, name = self.func
136136
show_func(fn, lineno, name, lstats.timings[self.func], lstats.unit, stream=out)
137137
self._line_stats_text = out.getvalue()
@@ -142,7 +142,7 @@ def line_stats_text(self):
142142

143143
class ProfilingDebugPanel(DebugPanel):
144144
"""
145-
Panel that displays the Django version.
145+
Panel that displays profiling information.
146146
"""
147147
name = 'Profiling'
148148
template = 'debug_toolbar/panels/profiling.html'
@@ -191,6 +191,7 @@ def add_node(self, func_list, func, max_depth, cum_time=0.1):
191191
def process_response(self, request, response):
192192
if not hasattr(self, 'profiler'):
193193
return None
194+
# Could be delayed until the panel content is requested (perf. optim.)
194195
self.profiler.create_stats()
195196
self.stats = DjangoDebugToolbarStats(self.profiler)
196197
if DJ_PROFILE_USE_LINE_PROFILER:

0 commit comments

Comments
 (0)