From 06c01648909072aec715535cfa796b58ce287e21 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Thu, 17 Oct 2013 09:03:06 +0200 Subject: Update introspection code. --- debug_toolbar/panels/profiling.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'debug_toolbar/panels/profiling.py') diff --git a/debug_toolbar/panels/profiling.py b/debug_toolbar/panels/profiling.py index f71472b..995cccb 100644 --- a/debug_toolbar/panels/profiling.py +++ b/debug_toolbar/panels/profiling.py @@ -155,12 +155,12 @@ class ProfilingDebugPanel(DebugPanel): return _('Profiling') def _unwrap_closure_and_profile(self, func): - if not hasattr(func, 'func_code'): + if not hasattr(func, '__code__'): return self.line_profiler.add_function(func) - if func.func_closure: - for cell in func.func_closure: - if hasattr(cell.cell_contents, 'func_code'): + if func.__closure__: + for cell in func.__closure__: + if hasattr(cell.cell_contents, '__code__'): self._unwrap_closure_and_profile(cell.cell_contents) def process_view(self, request, view_func, view_args, view_kwargs): -- cgit v1.2.3