Use asyncio.create_task over asyncio.ensure_future

This commit is contained in:
Nadir Chowdhury authored and GitHub committed 2021-04-05 20:31:03 -04:00
1 parent 7a7c4b4d62
commit 2ff24a27b5
4 files changed
+9 -9

No files matched your search

+1 -1
View File
@@ -369,7 +369,7 @@ async def async_all(gen, *, check=_isawaitable):
async def sane_wait_for(futures, *, timeout):
ensured = [
asyncio.ensure_future(fut) for fut in futures
asyncio.create_task(fut) for fut in futures
]
done, pending = await asyncio.wait(ensured, timeout=timeout, return_when=asyncio.ALL_COMPLETED)