forked from orbit-oss/flask
remove previously deprecated code (#5648)
This commit is contained in:
commit
d5b7a05ab2
2 changed files with 2 additions and 21 deletions
|
|
@ -3,6 +3,8 @@ Version 3.2.0
|
||||||
|
|
||||||
Unreleased
|
Unreleased
|
||||||
|
|
||||||
|
- Remove previously deprecated code: ``__version__``. :pr:`5648`
|
||||||
|
|
||||||
|
|
||||||
Version 3.1.0
|
Version 3.1.0
|
||||||
-------------
|
-------------
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,3 @@
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import typing as t
|
|
||||||
|
|
||||||
from . import json as json
|
from . import json as json
|
||||||
from .app import Flask as Flask
|
from .app import Flask as Flask
|
||||||
from .blueprints import Blueprint as Blueprint
|
from .blueprints import Blueprint as Blueprint
|
||||||
|
|
@ -41,20 +37,3 @@ from .templating import stream_template as stream_template
|
||||||
from .templating import stream_template_string as stream_template_string
|
from .templating import stream_template_string as stream_template_string
|
||||||
from .wrappers import Request as Request
|
from .wrappers import Request as Request
|
||||||
from .wrappers import Response as Response
|
from .wrappers import Response as Response
|
||||||
|
|
||||||
|
|
||||||
def __getattr__(name: str) -> t.Any:
|
|
||||||
if name == "__version__":
|
|
||||||
import importlib.metadata
|
|
||||||
import warnings
|
|
||||||
|
|
||||||
warnings.warn(
|
|
||||||
"The '__version__' attribute is deprecated and will be removed in"
|
|
||||||
" Flask 3.1. Use feature detection or"
|
|
||||||
" 'importlib.metadata.version(\"flask\")' instead.",
|
|
||||||
DeprecationWarning,
|
|
||||||
stacklevel=2,
|
|
||||||
)
|
|
||||||
return importlib.metadata.version("flask")
|
|
||||||
|
|
||||||
raise AttributeError(name)
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue