diff options
| author | Aymeric Augustin | 2013-10-17 09:03:06 +0200 |
|---|---|---|
| committer | Aymeric Augustin | 2013-10-17 18:24:58 +0200 |
| commit | 06c01648909072aec715535cfa796b58ce287e21 (patch) | |
| tree | 09b5aa5402901fdc6e8414edb9a692159e7597fd /debug_toolbar/panels/profiling.py | |
| parent | 90b1c1c5bafacc4c9967a427224f7ded935bb4a5 (diff) | |
| download | django-debug-toolbar-06c01648909072aec715535cfa796b58ce287e21.tar.bz2 | |
Update introspection code.
Diffstat (limited to 'debug_toolbar/panels/profiling.py')
| -rw-r--r-- | debug_toolbar/panels/profiling.py | 8 |
1 files changed, 4 insertions, 4 deletions
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): |
