From d2a6ec2ab84aec847b1598bb2a777103cea7fc9f Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Sat, 12 Jun 2021 17:39:37 +0100 Subject: [PATCH] fix py3.10 `asyncio` tests - fixes #1176 --- tqdm/asyncio.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tqdm/asyncio.py b/tqdm/asyncio.py index 0d3ba747..8f9b4ed6 100644 --- a/tqdm/asyncio.py +++ b/tqdm/asyncio.py @@ -8,6 +8,7 @@ Usage: ... ... """ import asyncio +from sys import version_info from .std import tqdm as std_tqdm @@ -60,7 +61,11 @@ class tqdm_asyncio(std_tqdm): """ if total is None: 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) @classmethod