|
|
|
@ -19,6 +19,7 @@ from werkzeug.exceptions import HTTPException
|
|
|
|
|
from .globals import _request_ctx_stack, _app_ctx_stack |
|
|
|
|
from .module import blueprint_is_module |
|
|
|
|
from .signals import appcontext_pushed, appcontext_popped |
|
|
|
|
from ._compat import BROKEN_PYPY_CTXMGR_EXIT |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class _AppCtxGlobals(object): |
|
|
|
@ -187,6 +188,9 @@ class AppContext(object):
|
|
|
|
|
def __exit__(self, exc_type, exc_value, tb): |
|
|
|
|
self.pop(exc_value) |
|
|
|
|
|
|
|
|
|
if BROKEN_PYPY_CTXMGR_EXIT and exc_type is not None: |
|
|
|
|
raise exc_type, exc_value, tb |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RequestContext(object): |
|
|
|
|
"""The request context contains all request relevant information. It is |
|
|
|
@ -390,6 +394,9 @@ class RequestContext(object):
|
|
|
|
|
# See flask.testing for how this works. |
|
|
|
|
self.auto_pop(exc_value) |
|
|
|
|
|
|
|
|
|
if BROKEN_PYPY_CTXMGR_EXIT and exc_type is not None: |
|
|
|
|
raise exc_type, exc_value, tb |
|
|
|
|
|
|
|
|
|
def __repr__(self): |
|
|
|
|
return '<%s \'%s\' [%s] of %s>' % ( |
|
|
|
|
self.__class__.__name__, |
|
|
|
|