mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
GH-94597: deprecate SafeChildWatcher
, FastChildWatcher
and MultiLoopChildWatcher
child watchers (#98089)
This commit is contained in:
parent
75751f4aa5
commit
d8765284f3
7 changed files with 81 additions and 38 deletions
|
@ -22,7 +22,7 @@ import errno
|
|||
import unittest
|
||||
from unittest import mock
|
||||
import weakref
|
||||
|
||||
import warnings
|
||||
if sys.platform not in ('win32', 'vxworks'):
|
||||
import tty
|
||||
|
||||
|
@ -2055,7 +2055,9 @@ else:
|
|||
class UnixEventLoopTestsMixin(EventLoopTestsMixin):
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
watcher = asyncio.SafeChildWatcher()
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter('ignore', DeprecationWarning)
|
||||
watcher = asyncio.SafeChildWatcher()
|
||||
watcher.attach_loop(self.loop)
|
||||
asyncio.set_child_watcher(watcher)
|
||||
|
||||
|
@ -2652,7 +2654,9 @@ class GetEventLoopTestsMixin:
|
|||
asyncio.set_event_loop(self.loop)
|
||||
|
||||
if sys.platform != 'win32':
|
||||
watcher = asyncio.SafeChildWatcher()
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter('ignore', DeprecationWarning)
|
||||
watcher = asyncio.SafeChildWatcher()
|
||||
watcher.attach_loop(self.loop)
|
||||
asyncio.set_child_watcher(watcher)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue