File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -636,7 +636,7 @@ def get_event_loop(self):
636
636
"""
637
637
if (self ._local ._loop is None and
638
638
not self ._local ._set_called and
639
- isinstance ( threading .current_thread (), threading ._MainThread )):
639
+ threading .current_thread () is threading .main_thread ( )):
640
640
self .set_event_loop (self .new_event_loop ())
641
641
642
642
if self ._local ._loop is None :
Original file line number Diff line number Diff line change @@ -1406,8 +1406,7 @@ def _init_watcher(self):
1406
1406
with events ._lock :
1407
1407
if self ._watcher is None : # pragma: no branch
1408
1408
self ._watcher = ThreadedChildWatcher ()
1409
- if isinstance (threading .current_thread (),
1410
- threading ._MainThread ):
1409
+ if threading .current_thread () is threading .main_thread ():
1411
1410
self ._watcher .attach_loop (self ._local ._loop )
1412
1411
1413
1412
def set_event_loop (self , loop ):
@@ -1421,7 +1420,7 @@ def set_event_loop(self, loop):
1421
1420
super ().set_event_loop (loop )
1422
1421
1423
1422
if (self ._watcher is not None and
1424
- isinstance ( threading .current_thread (), threading ._MainThread )):
1423
+ threading .current_thread () is threading .main_thread ( )):
1425
1424
self ._watcher .attach_loop (loop )
1426
1425
1427
1426
def get_child_watcher (self ):
You can’t perform that action at this time.
0 commit comments