mirror of
https://github.com/python/cpython.git
synced 2025-08-08 10:58:51 +00:00
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
f383ca1a6f
commit
83c7dd5200
3 changed files with 16 additions and 2 deletions
|
@ -3256,11 +3256,11 @@ class TextIO(IO[str]):
|
|||
|
||||
class _DeprecatedType(type):
|
||||
def __getattribute__(cls, name):
|
||||
if name not in ("__dict__", "__module__") and name in cls.__dict__:
|
||||
if name not in {"__dict__", "__module__", "__doc__"} and name in cls.__dict__:
|
||||
warnings.warn(
|
||||
f"{cls.__name__} is deprecated, import directly "
|
||||
f"from typing instead. {cls.__name__} will be removed "
|
||||
"in Python 3.12.",
|
||||
"in Python 3.13.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue