From f1b849e062bb761feebde8bc25af83f90fe79e5c Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Sat, 7 Nov 2020 03:01:25 +0000 Subject: [PATCH] fix py35 --- tqdm/asyncio.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tqdm/asyncio.py b/tqdm/asyncio.py index 9440711c..b354cf38 100644 --- a/tqdm/asyncio.py +++ b/tqdm/asyncio.py @@ -7,9 +7,9 @@ Usage: >>> async for i in trange(10): ... ... """ +import asyncio from .std import tqdm as std_tqdm from .utils import ensure_lock -import asyncio __author__ = {"github.com/": ["casperdcl"]} __all__ = ['tqdm_asyncio', 'tarange', 'tqdm', 'trange'] @@ -76,7 +76,8 @@ class tqdm_asyncio(std_tqdm): """ with ensure_lock(cls, lock_name=kwargs.get('lock_name', "")): tasks = [asyncio.create_task(i) for i in map(fn, *iterables)] - _ = [await i for i in cls.as_completed(tasks, **kwargs)] + for i in cls.as_completed(tasks, **kwargs): + await i return [i.result() for i in tasks]