GH-120804: Remove `PidfdChildWatcher`, `ThreadedChildWatcher` and `AbstractChildWatcher` from asyncio APIs by kumaraditya303 · Pull Request #120893 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
199 changes: 23 additions & 176 deletions Lib/asyncio/unix_events.py
26 changes: 4 additions & 22 deletions Lib/test/test_asyncio/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -2209,22 +2209,8 @@ def test_remove_fds_after_closing(self):
else:
import selectors

class UnixEventLoopTestsMixin(EventLoopTestsMixin):
def setUp(self):
super().setUp()
watcher = asyncio.ThreadedChildWatcher()
watcher.attach_loop(self.loop)
policy = asyncio.get_event_loop_policy()
policy._watcher = watcher

def tearDown(self):
policy = asyncio.get_event_loop_policy()
policy._watcher = None
super().tearDown()


if hasattr(selectors, 'KqueueSelector'):
class KqueueEventLoopTests(UnixEventLoopTestsMixin,
class KqueueEventLoopTests(EventLoopTestsMixin,
SubprocessTestsMixin,
test_utils.TestCase):

Expand All @@ -2249,23 +2235,23 @@ def test_write_pty(self):
super().test_write_pty()

if hasattr(selectors, 'EpollSelector'):
class EPollEventLoopTests(UnixEventLoopTestsMixin,
class EPollEventLoopTests(EventLoopTestsMixin,
SubprocessTestsMixin,
test_utils.TestCase):

def create_event_loop(self):
return asyncio.SelectorEventLoop(selectors.EpollSelector())

if hasattr(selectors, 'PollSelector'):
class PollEventLoopTests(UnixEventLoopTestsMixin,
class PollEventLoopTests(EventLoopTestsMixin,
SubprocessTestsMixin,
test_utils.TestCase):

def create_event_loop(self):
return asyncio.SelectorEventLoop(selectors.PollSelector())

# Should always exist.
class SelectEventLoopTests(UnixEventLoopTestsMixin,
class SelectEventLoopTests(EventLoopTestsMixin,
SubprocessTestsMixin,
test_utils.TestCase):

Expand Down Expand Up @@ -2830,10 +2816,6 @@ def setUp(self):

def tearDown(self):
try:
if sys.platform != 'win32':
policy = asyncio.get_event_loop_policy()
policy._watcher = None

super().tearDown()
finally:
self.loop.close()
Expand Down
30 changes: 12 additions & 18 deletions Lib/test/test_asyncio/test_subprocess.py
Loading