bpo-38951: Use threading.main_thread() check in asyncio (GH-17433)

https://bugs.python.org/issue38951
This commit is contained in:
Hill Ma 2019-12-05 04:40:12 -08:00 committed by Miss Islington (bot)
parent bb815499af
commit 99eb70a9eb
2 changed files with 3 additions and 4 deletions

View file

@ -636,7 +636,7 @@ class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy):
"""
if (self._local._loop is None and
not self._local._set_called and
isinstance(threading.current_thread(), threading._MainThread)):
threading.current_thread() is threading.main_thread()):
self.set_event_loop(self.new_event_loop())
if self._local._loop is None: