Fix tests for Python 3.11

This commit is contained in:
grossmj
2022-10-30 22:07:44 +08:00
parent ec50cc7c0d
commit 2d74d1ad94
2 changed files with 9 additions and 5 deletions

View File

@ -39,7 +39,7 @@ class Pool():
while len(self._tasks) > 0 or len(pending) > 0:
while len(self._tasks) > 0 and len(pending) < self._concurrency:
task, args, kwargs = self._tasks.pop(0)
pending.add(task(*args, **kwargs))
pending.add(asyncio.create_task(task(*args, **kwargs)))
(done, pending) = await asyncio.wait(pending, return_when=asyncio.FIRST_COMPLETED)
for task in done:
if task.exception():