Skip to content
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Doc/library/asyncio-policy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions Doc/whatsnew/3.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ 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`)


Pending Removal in Python 3.13
==============================
Expand Down Expand Up @@ -171,6 +178,7 @@ APIs:
* :func:`unittest.getTestCaseNames` (:gh:`50096`)
* :class:`webbrowser.MacOSX` (:gh:`86421`)


Pending Removal in Future Versions
==================================

Expand Down
1 change: 1 addition & 0 deletions Lib/asyncio/unix_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 6 additions & 7 deletions Lib/test/test_asyncio/test_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,13 +668,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):

Expand Down Expand Up @@ -702,6 +695,12 @@ class SubprocessPidfdWatcherTests(SubprocessWatcherMixin,
test_utils.TestCase):
Watcher = unix_events.PidfdChildWatcher


class MultiLoopChildWatcherTests(unittest.TestCase):
def test_deprecated(self):
with self.assertWarns(DeprecationWarning):
asyncio.MultiLoopChildWatcher()

else:
# Windows
class SubprocessProactorTests(SubprocessMixin, test_utils.TestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate :class:`asyncio.MultiLoopChildWatcher` to be removed in Python 3.14.