|
|
@ -163,6 +163,8 @@ class AppContext(object): |
|
|
|
def push(self): |
|
|
|
def push(self): |
|
|
|
"""Binds the app context to the current context.""" |
|
|
|
"""Binds the app context to the current context.""" |
|
|
|
self._refcnt += 1 |
|
|
|
self._refcnt += 1 |
|
|
|
|
|
|
|
if hasattr(sys, 'exc_clear'): |
|
|
|
|
|
|
|
sys.exc_clear() |
|
|
|
_app_ctx_stack.push(self) |
|
|
|
_app_ctx_stack.push(self) |
|
|
|
appcontext_pushed.send(self.app) |
|
|
|
appcontext_pushed.send(self.app) |
|
|
|
|
|
|
|
|
|
|
@ -312,6 +314,9 @@ class RequestContext(object): |
|
|
|
else: |
|
|
|
else: |
|
|
|
self._implicit_app_ctx_stack.append(None) |
|
|
|
self._implicit_app_ctx_stack.append(None) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if hasattr(sys, 'exc_clear'): |
|
|
|
|
|
|
|
sys.exc_clear() |
|
|
|
|
|
|
|
|
|
|
|
_request_ctx_stack.push(self) |
|
|
|
_request_ctx_stack.push(self) |
|
|
|
|
|
|
|
|
|
|
|
# Open the session at the moment that the request context is |
|
|
|
# Open the session at the moment that the request context is |
|
|
|