diff --git a/Doc/library/asyncio-policy.rst b/Doc/library/asyncio-policy.rst index ef6a0588506b52..b2e2ab3ed834f8 100644 --- a/Doc/library/asyncio-policy.rst +++ b/Doc/library/asyncio-policy.rst @@ -232,6 +232,7 @@ implementation used by the asyncio event loop: :py:data:`SIGCHLD` is received). .. versionadded:: 3.8 + .. deprecated-removed:: 3.12 3.14 .. class:: SafeChildWatcher diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index ddf9e1f6a59b47..2efb8c9358ada7 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -139,6 +139,18 @@ CPython bytecode changes Deprecated ========== +The following modules and APIs have been deprecated in this Python release, +and will be removed in Python 3.14. + +APIs: + +* :class:`asyncio.MultiLoopChildWatcher` (:gh:`94648`) + +The following APIs were deprecated in this Python release and will be removed, +although there is currently no date scheduled for their removal. + +APIs: + * :class:`typing.Hashable` and :class:`typing.Sized` aliases for :class:`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:gh:`94309`.) diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py index cf7683fee64621..f5a035b3bb06de 100644 --- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -1229,6 +1229,7 @@ class MultiLoopChildWatcher(AbstractChildWatcher): # but retrieves the current loop by get_running_loop() def __init__(self): + warnings._deprecated("asyncio.MultiLoopChildWatcher", remove=(3, 14)) self._callbacks = {} self._saved_sighandler = None diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py index 961c463f8dc11b..af157b4a30ca3b 100644 --- a/Lib/test/test_asyncio/test_subprocess.py +++ b/Lib/test/test_asyncio/test_subprocess.py @@ -666,13 +666,6 @@ class SubprocessThreadedWatcherTests(SubprocessWatcherMixin, Watcher = unix_events.ThreadedChildWatcher - @unittest.skip("bpo-38323: MultiLoopChildWatcher has a race condition \ - and these tests can hang the test suite") - class SubprocessMultiLoopWatcherTests(SubprocessWatcherMixin, - test_utils.TestCase): - - Watcher = unix_events.MultiLoopChildWatcher - class SubprocessSafeWatcherTests(SubprocessWatcherMixin, test_utils.TestCase): @@ -701,6 +694,11 @@ class SubprocessPidfdWatcherTests(SubprocessWatcherMixin, Watcher = unix_events.PidfdChildWatcher + class MultiLoopChildWatcherTests(unittest.TestCase): + def test_deprecated(self): + with self.assertWarns(DeprecationWarning): + asyncio.MultiLoopChildWatcher() + class GenericWatcherTests(test_utils.TestCase): def test_create_subprocess_fails_with_inactive_watcher(self): diff --git a/Misc/NEWS.d/next/Library/2022-07-07-09-04-49.gh-issue-82504.6xtYAz.rst b/Misc/NEWS.d/next/Library/2022-07-07-09-04-49.gh-issue-82504.6xtYAz.rst new file mode 100644 index 00000000000000..91c7a6543a60c5 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-07-07-09-04-49.gh-issue-82504.6xtYAz.rst @@ -0,0 +1 @@ +Deprecate :class:`asyncio.MultiLoopChildWatcher` to be removed in Python 3.14.