fix `contrib.concurrent` with generators

- fixes #1231
This commit is contained in:
Casper da Costa-Luis 2021-08-22 19:51:08 +01:00 committed by Casper da Costa-Luis
parent 8c35d4228c
commit 98f7289675
1 changed files with 1 additions and 1 deletions

View File

@ -58,7 +58,7 @@ def _executor_map(PoolExecutor, fn, *iterables, **tqdm_kwargs):
"""
kwargs = tqdm_kwargs.copy()
if "total" not in kwargs:
kwargs["total"] = len(iterables[0])
kwargs["total"] = length_hint(iterables[0])
tqdm_class = kwargs.pop("tqdm_class", tqdm_auto)
max_workers = kwargs.pop("max_workers", min(32, cpu_count() + 4))
chunksize = kwargs.pop("chunksize", 1)