pull/129/head v0.0.21
cirospaciari 2023-06-24 17:12:08 -03:00
rodzic a63b75e30a
commit 375b5e0d14
1 zmienionych plików z 9 dodań i 2 usunięć

Wyświetl plik

@ -129,8 +129,15 @@ class Loop:
def run_once(self):
# run one step of asyncio
self.loop._stopping = True
self.loop._run_once()
# if loop._run_once is not available use loop.run_forever + loop.call_soon(loop.stop)
# this is useful when using uvloop or custom loops
try:
self.loop._stopping = True
self.loop._run_once()
except Exception:
# this can be _StopError with means we should not call run_forever, but we can ignore it
self.loop.call_soon(self.loop.stop)
self.loop.run_forever()
# run one step of libuv
self.uv_loop.run_once()