mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
gh-76007: Deprecate __version__ attribute (#138675)
Co-authored-by: AN Long <aisk@users.noreply.github.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
This commit is contained in:
parent
408154d64a
commit
872eafd2b0
34 changed files with 320 additions and 29 deletions
|
|
@ -21,8 +21,6 @@
|
|||
(options, args) = parser.parse_args()
|
||||
"""
|
||||
|
||||
__version__ = "1.5.3"
|
||||
|
||||
__all__ = ['Option',
|
||||
'make_option',
|
||||
'SUPPRESS_HELP',
|
||||
|
|
@ -1669,3 +1667,12 @@ def _match_abbrev(s, wordmap):
|
|||
# which will become a factory function when there are many Option
|
||||
# classes.
|
||||
make_option = Option
|
||||
|
||||
|
||||
def __getattr__(name):
|
||||
if name == "__version__":
|
||||
from warnings import _deprecated
|
||||
|
||||
_deprecated("__version__", remove=(3, 20))
|
||||
return "1.5.3" # Do not change
|
||||
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue