We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ef85df1 + 751c7c0 commit 289cae4Copy full SHA for 289cae4
Lib/asyncio/base_events.py
@@ -332,8 +332,11 @@ def _assert_is_current_event_loop(self):
332
Should only be called when (self._debug == True). The caller is
333
responsible for checking this condition for performance reasons.
334
"""
335
- current = events.get_event_loop()
336
- if current is not None and current is not self:
+ try:
+ current = events.get_event_loop()
337
+ except AssertionError:
338
+ return
339
+ if current is not self:
340
raise RuntimeError(
341
"non-threadsafe operation invoked on an event loop other "
342
"than the current one")
0 commit comments