@@ -131,7 +131,7 @@ def line_stats_text(self):
131
131
if self ._line_stats_text is None and DJ_PROFILE_USE_LINE_PROFILER :
132
132
lstats = self .statobj .line_stats
133
133
if self .func in lstats .timings :
134
- out = cStringIO . StringIO ()
134
+ out = cStringIO ()
135
135
fn , lineno , name = self .func
136
136
show_func (fn , lineno , name , lstats .timings [self .func ], lstats .unit , stream = out )
137
137
self ._line_stats_text = out .getvalue ()
@@ -142,7 +142,7 @@ def line_stats_text(self):
142
142
143
143
class ProfilingDebugPanel (DebugPanel ):
144
144
"""
145
- Panel that displays the Django version .
145
+ Panel that displays profiling information .
146
146
"""
147
147
name = 'Profiling'
148
148
template = 'debug_toolbar/panels/profiling.html'
@@ -191,6 +191,7 @@ def add_node(self, func_list, func, max_depth, cum_time=0.1):
191
191
def process_response (self , request , response ):
192
192
if not hasattr (self , 'profiler' ):
193
193
return None
194
+ # Could be delayed until the panel content is requested (perf. optim.)
194
195
self .profiler .create_stats ()
195
196
self .stats = DjangoDebugToolbarStats (self .profiler )
196
197
if DJ_PROFILE_USE_LINE_PROFILER :
0 commit comments