Skip to content

Commit d5b7a05

Browse files
authored
remove previously deprecated code (pallets#5648)
2 parents 4fec712 + d22bfcd commit d5b7a05

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

CHANGES.rst

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Version 3.2.0
33

44
Unreleased
55

6+
- Remove previously deprecated code: ``__version__``. :pr:`5648`
7+
68

79
Version 3.1.0
810
-------------

src/flask/__init__.py

-21
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
from __future__ import annotations
2-
3-
import typing as t
4-
51
from . import json as json
62
from .app import Flask as Flask
73
from .blueprints import Blueprint as Blueprint
@@ -41,20 +37,3 @@
4137
from .templating import stream_template_string as stream_template_string
4238
from .wrappers import Request as Request
4339
from .wrappers import Response as Response
44-
45-
46-
def __getattr__(name: str) -> t.Any:
47-
if name == "__version__":
48-
import importlib.metadata
49-
import warnings
50-
51-
warnings.warn(
52-
"The '__version__' attribute is deprecated and will be removed in"
53-
" Flask 3.1. Use feature detection or"
54-
" 'importlib.metadata.version(\"flask\")' instead.",
55-
DeprecationWarning,
56-
stacklevel=2,
57-
)
58-
return importlib.metadata.version("flask")
59-
60-
raise AttributeError(name)

0 commit comments

Comments
 (0)