"""
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:
with events._lock:
if self._watcher is None: # pragma: no branch
self._watcher = ThreadedChildWatcher()
- if isinstance(threading.current_thread(),
- threading._MainThread):
+ if threading.current_thread() is threading.main_thread():
self._watcher.attach_loop(self._local._loop)
def set_event_loop(self, loop):
super().set_event_loop(loop)
if (self._watcher is not None and
- isinstance(threading.current_thread(), threading._MainThread)):
+ threading.current_thread() is threading.main_thread()):
self._watcher.attach_loop(loop)
def get_child_watcher(self):