summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/unix_events.py
diff options
context:
space:
mode:
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>2022-11-12 07:17:53 (GMT)
committerGitHub <noreply@github.com>2022-11-12 07:17:53 (GMT)
commitaa874326d86734606a1930e7f48e2ee204cae0b6 (patch)
treee0f68cc2b753c4b5f43ec278ed5e95650df88b9e /Lib/asyncio/unix_events.py
parente02cc6d42aee1f0a9ee629f76576eee478224d9d (diff)
downloadcpython-aa874326d86734606a1930e7f48e2ee204cae0b6.zip
cpython-aa874326d86734606a1930e7f48e2ee204cae0b6.tar.gz
cpython-aa874326d86734606a1930e7f48e2ee204cae0b6.tar.bz2
GH-94597: add deprecation warnings for subclassing `AbstractChildWatcher` (#99386)
Diffstat (limited to 'Lib/asyncio/unix_events.py')
-rw-r--r--Lib/asyncio/unix_events.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py
index 2de7a1b..b21e039 100644
--- a/Lib/asyncio/unix_events.py
+++ b/Lib/asyncio/unix_events.py
@@ -846,6 +846,13 @@ class AbstractChildWatcher:
waitpid(-1), there should be only one active object per process.
"""
+ def __init_subclass__(cls) -> None:
+ if cls.__module__ != __name__:
+ warnings._deprecated("AbstractChildWatcher",
+ "{name!r} is deprecated as of Python 3.12 and will be "
+ "removed in Python {remove}.",
+ remove=(3, 14))
+
def add_child_handler(self, pid, callback, *args):
"""Register a new child handler.