bpo-31641: Allow arbitrary iterables in concurrent.futures.as_completed() (#3830)

This was possible before.  GH-1560 introduced a regression after 3.6.2 got
released where only sequences were accepted now.  This commit addresses this
problem.
This commit is contained in:
Łukasz Langa 2017-09-29 14:33:34 -07:00 committed by GitHub
parent 01c6a8859e
commit 574562c5dd
2 changed files with 6 additions and 3 deletions

View file

@ -214,9 +214,8 @@ def as_completed(fs, timeout=None):
if timeout is not None:
end_time = timeout + time.time()
total_futures = len(fs)
fs = set(fs)
total_futures = len(fs)
with _AcquireFutures(fs):
finished = set(
f for f in fs