From 23bf2633f67d00418bd31c0c6918c3a99f06dead Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 29 Aug 2011 12:18:25 +0200 Subject: [PATCH] Use the _request_ctx_stack instead of the proxy for consistency with the others. --- flask/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flask/app.py b/flask/app.py index 1136469f..609ab952 100644 --- a/flask/app.py +++ b/flask/app.py @@ -1397,7 +1397,7 @@ class Flask(_PackageBoundObject): This also triggers the :meth:`url_value_processor` functions before the actualy :meth:`before_request` functions are called. """ - bp = request.blueprint + bp = _request_ctx_stack.top.request.blueprint funcs = self.url_value_preprocessors.get(None, ()) if bp is not None and bp in self.url_value_preprocessors: @@ -1447,7 +1447,7 @@ class Flask(_PackageBoundObject): tighter control over certain resources under testing environments. """ funcs = reversed(self.teardown_request_funcs.get(None, ())) - bp = request.blueprint + bp = _request_ctx_stack.top.request.blueprint if bp is not None and bp in self.teardown_request_funcs: funcs = chain(funcs, reversed(self.teardown_request_funcs[bp])) exc = sys.exc_info()[1]