summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/events.py
diff options
context:
space:
mode:
authorHill Ma <mahiuchun@users.noreply.github.com>2019-12-05 12:40:12 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-12-05 12:40:12 (GMT)
commit99eb70a9eb9493602ff6ad8bb92df4318cf05a3e (patch)
treeeccbf5c0c0ce2c69a4eac2dab15ab99a5676e393 /Lib/asyncio/events.py
parentbb815499af855b1759c02535f8d7a9d0358e74e8 (diff)
downloadcpython-99eb70a9eb9493602ff6ad8bb92df4318cf05a3e.zip
cpython-99eb70a9eb9493602ff6ad8bb92df4318cf05a3e.tar.gz
cpython-99eb70a9eb9493602ff6ad8bb92df4318cf05a3e.tar.bz2
bpo-38951: Use threading.main_thread() check in asyncio (GH-17433)
https://bugs.python.org/issue38951
Diffstat (limited to 'Lib/asyncio/events.py')
-rw-r--r--Lib/asyncio/events.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py
index 36b7ea3..c7343f5 100644
--- a/Lib/asyncio/events.py
+++ b/Lib/asyncio/events.py
@@ -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: