From 9971ea924ffea7f129842b9a3eef03a8d8def3b9 Mon Sep 17 00:00:00 2001 From: jay817 Date: Mon, 25 Nov 2024 14:05:41 -0500 Subject: [PATCH] Update nest-asyncio/README.md --- nest-asyncio/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nest-asyncio/README.md b/nest-asyncio/README.md index e2d50d4..998ae20 100644 --- a/nest-asyncio/README.md +++ b/nest-asyncio/README.md @@ -1,12 +1,12 @@ ```python import asyncio (loop := asyncio.get_event_loop()).__class__._check_running = lambda _: None -def _run_once(self): - self._process_events(self._selector.select(0)) - if (ready := self._ready) and not (handle := ready.popleft())._cancelled: - task = (tasks := asyncio.tasks._current_tasks).pop(self, None) +def _run_once(loop): + loop._process_events(loop._selector.select(0)) + if (ready := loop._ready) and not (handle := ready.popleft())._cancelled: + task = (tasks := asyncio.tasks._current_tasks).pop(loop, None) handle._run() - tasks[self] = task + tasks[loop] = task loop.__class__._run_once = _run_once asyncio.run = loop.run_until_complete