fix py3.10 `asyncio` tests

- fixes #1176
This commit is contained in:
Casper da Costa-Luis 2021-06-12 17:39:37 +01:00
parent 9f4ae743fe
commit d2a6ec2ab8
No known key found for this signature in database
GPG Key ID: F5126E5FBD2512AD
1 changed files with 6 additions and 1 deletions

View File

@ -8,6 +8,7 @@ Usage:
... ... ... ...
""" """
import asyncio import asyncio
from sys import version_info
from .std import tqdm as std_tqdm from .std import tqdm as std_tqdm
@ -60,7 +61,11 @@ class tqdm_asyncio(std_tqdm):
""" """
if total is None: if total is None:
total = len(fs) total = len(fs)
yield from cls(asyncio.as_completed(fs, loop=loop, timeout=timeout),
kwargs = {}
if version_info[:2] < (3, 10):
kwargs['loop'] = loop
yield from cls(asyncio.as_completed(fs, timeout=timeout, **kwargs),
total=total, **tqdm_kwargs) total=total, **tqdm_kwargs)
@classmethod @classmethod