Skip to content

Commit

Permalink
remove previously deprecated code (#5648)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism authored Nov 23, 2024
2 parents 4fec712 + d22bfcd commit d5b7a05
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Version 3.2.0

Unreleased

- Remove previously deprecated code: ``__version__``. :pr:`5648`


Version 3.1.0
-------------
Expand Down
21 changes: 0 additions & 21 deletions src/flask/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -41,20 +37,3 @@
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)

0 comments on commit d5b7a05

Please sign in to comment.