From: Thomas Grainger Date: Sun, 15 Oct 2023 14:51:13 +0000 (-0700) Subject: [3.11] remove redundant call to attach_loop in watcher (GH-110847) (#110870) X-Git-Tag: v3.11.7~184 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fd1b314cd3fc58e9155306e2d907492ed272c567;p=thirdparty%2FPython%2Fcpython.git [3.11] remove redundant call to attach_loop in watcher (GH-110847) (#110870) (cherry picked from commit 596589104fe5a4d90cb145b2cc69b71cc9aa9f07) --- diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py index ac4519acc430..0d4ba72603e6 100644 --- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -1443,8 +1443,6 @@ class _UnixDefaultEventLoopPolicy(events.BaseDefaultEventLoopPolicy): 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.