mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-30 17:41:54 +08:00
python 3.11 fixes
This commit is contained in:
@@ -202,7 +202,7 @@ async def wait_infinite() -> None:
|
||||
await asyncio.sleep(3600)
|
||||
|
||||
|
||||
async def wait_first(*aws: Awaitable) -> tuple[set[asyncio.Task], set[asyncio.Task]]:
|
||||
async def wait_first(*aws: (asyncio.Future | asyncio.Task)) -> tuple[set[asyncio.Task], set[asyncio.Task]]:
|
||||
return (await asyncio.wait(list(aws), return_when=asyncio.FIRST_COMPLETED))
|
||||
|
||||
|
||||
@@ -242,7 +242,10 @@ class AioNotifier:
|
||||
await self.__queue.get()
|
||||
else:
|
||||
try:
|
||||
await asyncio.wait_for(self.__queue.get(), timeout=timeout)
|
||||
await asyncio.wait_for(
|
||||
asyncio.ensure_future(self.__queue.get()),
|
||||
timeout=timeout,
|
||||
)
|
||||
except asyncio.TimeoutError:
|
||||
return # False
|
||||
while not self.__queue.empty():
|
||||
|
||||
Reference in New Issue
Block a user