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

@ -9,6 +9,7 @@ import sys
import threading
import unittest
from unittest import mock
import warnings
from test.support import socket_helper
try:
import ssl
@ -791,8 +792,9 @@ os.close(fd)
protocol = asyncio.StreamReaderProtocol(reader, loop=self.loop)
transport, _ = self.loop.run_until_complete(
self.loop.connect_read_pipe(lambda: protocol, pipe))
watcher = asyncio.SafeChildWatcher()
with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
watcher = asyncio.SafeChildWatcher()
watcher.attach_loop(self.loop)
try:
asyncio.set_child_watcher(watcher)