summaryrefslogtreecommitdiffstats
path: root/Lib/concurrent
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2017-09-29 22:07:01 (GMT)
committerƁukasz Langa <lukasz@langa.pl>2017-09-29 22:07:01 (GMT)
commit9ef28b6ad3d5aff767e3d852499def8b5ae5ff5d (patch)
treed801ff4ba3fa54a887e792a2d2364310be6ef6b1 /Lib/concurrent
parent66c2b9f13ef2197a5212fd58372173124df76467 (diff)
downloadcpython-9ef28b6ad3d5aff767e3d852499def8b5ae5ff5d.zip
cpython-9ef28b6ad3d5aff767e3d852499def8b5ae5ff5d.tar.gz
cpython-9ef28b6ad3d5aff767e3d852499def8b5ae5ff5d.tar.bz2
[3.6] bpo-31641: Allow arbitrary iterables in `concurrent.futures.as_completed()` (GH-3830) (#3831)
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. (cherry picked from commit 574562c5ddb2f0429aab9af762442e6f9a3f26ab)
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