GH-94597: Deprecate child watcher getters and setters (#98215)

This is the next step for deprecating child watchers.

Until we've removed the API completely we have to use it, so this PR is mostly suppressing a lot of warnings when using the API internally.

Once the child watcher API is totally removed, the two child watcher implementations we actually use and need (Pidfd and Thread) will be turned into internal helpers.
This commit is contained in:
Kumar Aditya 2022-10-16 04:39:30 +05:30 committed by GitHub
parent bb56dead33
commit 660f10248b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 104 additions and 51 deletions

View file

@ -14,7 +14,7 @@ import sys
import threading
import unittest
import weakref
import warnings
from unittest import mock
from http.server import HTTPServer
@ -544,7 +544,9 @@ class TestCase(unittest.TestCase):
policy = support.maybe_get_event_loop_policy()
if policy is not None:
try:
watcher = policy.get_child_watcher()
with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
watcher = policy.get_child_watcher()
except NotImplementedError:
# watcher is not implemented by EventLoopPolicy, e.g. Windows
pass