forked from orbit-oss/flask
contexts no longer use LocalStack
This commit is contained in:
parent
0b2f809f9b
commit
d597db67de
5 changed files with 146 additions and 71 deletions
|
|
@ -11,8 +11,6 @@ from .ctx import after_this_request as after_this_request
|
|||
from .ctx import copy_current_request_context as copy_current_request_context
|
||||
from .ctx import has_app_context as has_app_context
|
||||
from .ctx import has_request_context as has_request_context
|
||||
from .globals import _app_ctx_stack as _app_ctx_stack
|
||||
from .globals import _request_ctx_stack as _request_ctx_stack
|
||||
from .globals import current_app as current_app
|
||||
from .globals import g as g
|
||||
from .globals import request as request
|
||||
|
|
@ -45,3 +43,29 @@ from .templating import stream_template as stream_template
|
|||
from .templating import stream_template_string as stream_template_string
|
||||
|
||||
__version__ = "2.2.0.dev0"
|
||||
|
||||
|
||||
def __getattr__(name):
|
||||
if name == "_app_ctx_stack":
|
||||
import warnings
|
||||
from .globals import __app_ctx_stack
|
||||
|
||||
warnings.warn(
|
||||
"'_app_ctx_stack' is deprecated and will be removed in Flask 2.3.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
return __app_ctx_stack
|
||||
|
||||
if name == "_request_ctx_stack":
|
||||
import warnings
|
||||
from .globals import __request_ctx_stack
|
||||
|
||||
warnings.warn(
|
||||
"'_request_ctx_stack' is deprecated and will be removed in Flask 2.3.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
return __request_ctx_stack
|
||||
|
||||
raise AttributeError(name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue