Fix more deprecation warnings

This commit is contained in:
Rapptz
2019-11-20 03:04:04 -05:00
parent 1b040fd4ba
commit 4ef0fb0d95
3 changed files with 6 additions and 3 deletions

View File

@ -328,7 +328,10 @@ async def async_all(gen, *, check=_isawaitable):
return True
async def sane_wait_for(futures, *, timeout):
done, pending = await asyncio.wait(futures, timeout=timeout, return_when=asyncio.ALL_COMPLETED)
ensured = [
asyncio.ensure_future(fut) for fut in futures
]
done, pending = await asyncio.wait(ensured, timeout=timeout, return_when=asyncio.ALL_COMPLETED)
if len(pending) != 0:
raise asyncio.TimeoutError()