From 6efb9f2e9fcb9485571e9e332b8000331d0f3c01 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Sat, 14 Oct 2023 01:24:02 -0700 Subject: [PATCH] [3.11] remove redundant call to attach_loop in watcher (GH-110847) (cherry picked from commit 596589104fe5a4d90cb145b2cc69b71cc9aa9f07) Co-authored-by: Thomas Grainger --- Lib/asyncio/unix_events.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py index ac4519acc4307b..0d4ba72603e675 100644 --- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -1443,8 +1443,6 @@ def _init_watcher(self): with events._lock: if self._watcher is None: # pragma: no branch self._watcher = ThreadedChildWatcher() - if threading.current_thread() is threading.main_thread(): - self._watcher.attach_loop(self._local._loop) def set_event_loop(self, loop): """Set the event loop.