summaryrefslogtreecommitdiffstats
path: root/Lib/concurrent
diff options
context:
space:
mode:
authorƁukasz Langa <lukasz@langa.pl>2017-09-29 21:33:34 (GMT)
committerGitHub <noreply@github.com>2017-09-29 21:33:34 (GMT)
commit574562c5ddb2f0429aab9af762442e6f9a3f26ab (patch)
treef96b2636a2c5046e6b232e42011d8f509d69bdc7 /Lib/concurrent
parent01c6a8859ef2ff5545a87cf537573bd342c848bf (diff)
downloadcpython-574562c5ddb2f0429aab9af762442e6f9a3f26ab.zip
cpython-574562c5ddb2f0429aab9af762442e6f9a3f26ab.tar.gz
cpython-574562c5ddb2f0429aab9af762442e6f9a3f26ab.tar.bz2
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.
Diffstat (limited to 'Lib/concurrent')
-rw-r--r--Lib/concurrent/futures/_base.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/concurrent/futures/_base.py b/Lib/concurrent/futures/_base.py
index 70c7b61..6bace6c 100644
--- a/Lib/concurrent/futures/_base.py
+++ b/Lib/concurrent/futures/_base.py
@@ -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