From c9c0228a62326572ccebe01a5589b0859e6ec842 Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Tue, 4 Sep 2012 19:45:51 -0500 Subject: [PATCH] Profiler: Use update_wrapper on partial The `update_wrapper` call is needed so that the new partial func inherits the `__module__` of the original function. The `__module__` is needed because the request-vars panel uses `func.__module__` in building the qualified name. --- flask_debugtoolbar/panels/profiler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flask_debugtoolbar/panels/profiler.py b/flask_debugtoolbar/panels/profiler.py index 96a5e9a..e8e9e35 100644 --- a/flask_debugtoolbar/panels/profiler.py +++ b/flask_debugtoolbar/panels/profiler.py @@ -37,7 +37,9 @@ class ProfilerDebugPanel(DebugPanel): def process_view(self, request, view_func, view_kwargs): if self.is_active: - return functools.partial(self.profiler.runcall, view_func) + func = functools.partial(self.profiler.runcall, view_func) + functools.update_wrapper(func, view_func) + return func def process_response(self, request, response): if not self.is_active: