From 0c56c0502270ebe29461fe5cab3ee4d6111da650 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Sat, 14 Oct 2023 12:27:08 +0200 Subject: [PATCH] [3.12] remove redundant call to attach_loop in watcher (GH-110847) (#110867) (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 f985f9776ed0..0a618c42d2d2 100644 --- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -1461,8 +1461,6 @@ class _UnixDefaultEventLoopPolicy(events.BaseDefaultEventLoopPolicy): self._watcher = PidfdChildWatcher() else: 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. -- 2.47.3