Deprecate Flask.should_ignore_error: emits DeprecationWarning and returns False for backward compatibility
This commit is contained in:
parent
2579ce9f18
commit
c9e727b2bc
1 changed files with 17 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ from inspect import iscoroutinefunction
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
from types import TracebackType
|
from types import TracebackType
|
||||||
from urllib.parse import quote as _url_quote
|
from urllib.parse import quote as _url_quote
|
||||||
|
import warnings
|
||||||
|
|
||||||
import click
|
import click
|
||||||
from werkzeug.datastructures import Headers
|
from werkzeug.datastructures import Headers
|
||||||
|
|
@ -1589,3 +1590,19 @@ class Flask(App):
|
||||||
wrapped to apply middleware.
|
wrapped to apply middleware.
|
||||||
"""
|
"""
|
||||||
return self.wsgi_app(environ, start_response)
|
return self.wsgi_app(environ, start_response)
|
||||||
|
|
||||||
|
def should_ignore_error(self, error):
|
||||||
|
"""
|
||||||
|
Deprecated: this method is no longer meaningful in Flask's current
|
||||||
|
context preservation design. It will be removed in a future release.
|
||||||
|
|
||||||
|
Kept for backwards compatibility — it always returns False.
|
||||||
|
"""
|
||||||
|
import warnings
|
||||||
|
warnings.warn(
|
||||||
|
"Flask.should_ignore_error is deprecated and will be removed in a "
|
||||||
|
"future release. It currently always returns False and should not be used.",
|
||||||
|
DeprecationWarning,
|
||||||
|
stacklevel=2,
|
||||||
|
)
|
||||||
|
return False
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue