GH-94597: deprecate SafeChildWatcher, FastChildWatcher and MultiLoopChildWatcher child watchers (#98089)

This commit is contained in:
Kumar Aditya 2022-10-09 02:22:19 +05:30 committed by GitHub
parent 75751f4aa5
commit d8765284f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 81 additions and 38 deletions

View file

@ -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)