diff --git a/nest_asyncio.py b/nest_asyncio.py index 7b7466a..5f17c0b 100644 --- a/nest_asyncio.py +++ b/nest_asyncio.py @@ -117,7 +117,9 @@ def _run_once(self): handle = heappop(scheduled) ready.append(handle) - while ready: + for _ in range(len(ready)): + if not ready: + break handle = ready.popleft() if not handle._cancelled: handle._run()