diff --git a/asgiref/sync.py b/asgiref/sync.py index f263a432..4427fc2a 100644 --- a/asgiref/sync.py +++ b/asgiref/sync.py @@ -478,6 +478,8 @@ async def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _R: pass except IndexError: pass + if exec_coro.done(): + raise if cancel_parent: exec_coro.cancel() ret = await exec_coro