diff --git a/asgiref/sync.py b/asgiref/sync.py index 54496efe..ffe6047f 100644 --- a/asgiref/sync.py +++ b/asgiref/sync.py @@ -231,7 +231,7 @@ async def new_loop_wrap() -> None: finally: del self.loop_thread_executors[loop] - if self.main_event_loop is not None: + if self.main_event_loop is not None and self.main_event_loop.is_running(): try: self.main_event_loop.call_soon_threadsafe( self.main_event_loop.create_task, awaitable