remove previously deprecated code

This commit is contained in:
David Lord 2024-11-23 15:41:36 -08:00
parent 4fec712f32
commit d22bfcd4cf
No known key found for this signature in database
GPG Key ID: 43368A7AA8CC5926
2 changed files with 2 additions and 21 deletions

View File

@ -3,6 +3,8 @@ Version 3.2.0
Unreleased
- Remove previously deprecated code: ``__version__``. :pr:`5648`
Version 3.1.0
-------------

View File

@ -1,7 +1,3 @@
from __future__ import annotations
import typing as t
from . import json as json
from .app import Flask as Flask
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 .wrappers import Request as Request
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)