[3.11] remove redundant call to attach_loop in watcher (GH-110847) (#110870)

(cherry picked from commit 596589104f)
This commit is contained in:
Thomas Grainger 2023-10-15 07:51:13 -07:00 committed by GitHub
parent 5c55f50a71
commit fd1b314cd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.