forked from orbit-oss/flask
deprecate markupsafe exports
This commit is contained in:
parent
1ee22e1736
commit
9c02f07f9b
8 changed files with 41 additions and 20 deletions
|
|
@ -1,6 +1,3 @@
|
|||
from markupsafe import escape
|
||||
from markupsafe import Markup
|
||||
|
||||
from . import json as json
|
||||
from .app import Flask as Flask
|
||||
from .app import Request as Request
|
||||
|
|
@ -68,4 +65,28 @@ def __getattr__(name):
|
|||
)
|
||||
return __request_ctx_stack
|
||||
|
||||
if name == "escape":
|
||||
import warnings
|
||||
from markupsafe import escape
|
||||
|
||||
warnings.warn(
|
||||
"'flask.escape' is deprecated and will be removed in Flask 2.4. Import"
|
||||
" 'markupsafe.escape' instead.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
return escape
|
||||
|
||||
if name == "escape":
|
||||
import warnings
|
||||
from markupsafe import Markup
|
||||
|
||||
warnings.warn(
|
||||
"'flask.Markup' is deprecated and will be removed in Flask 2.4. Import"
|
||||
" 'markupsafe.Markup' instead.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
return Markup
|
||||
|
||||
raise AttributeError(name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue