Skip to content

Commit

Permalink
fix py3.10 asyncio tests
Browse files Browse the repository at this point in the history
- fixes tqdm#1176
  • Loading branch information
casperdcl committed Jun 12, 2021
1 parent 9f4ae74 commit d2a6ec2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tqdm/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
... ...
"""
import asyncio
from sys import version_info

from .std import tqdm as std_tqdm

Expand Down Expand Up @@ -60,7 +61,11 @@ def as_completed(cls, fs, *, loop=None, timeout=None, total=None, **tqdm_kwargs)
"""
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
Expand Down

0 comments on commit d2a6ec2

Please sign in to comment.