Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions Lib/concurrent/futures/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,6 @@ def _on_queue_feeder_error(self, e, obj):
super()._on_queue_feeder_error(e, obj)


def _get_chunks(*iterables, chunksize):
""" Iterates over zip()ed iterables in chunks. """
it = zip(*iterables)
while True:
chunk = tuple(itertools.islice(it, chunksize))
if not chunk:
return
yield chunk


def _process_chunk(fn, chunk):
""" Processes a chunk of an iterable passed to map.

Expand Down Expand Up @@ -847,7 +837,7 @@ def map(self, fn, *iterables, timeout=None, chunksize=1):
raise ValueError("chunksize must be >= 1.")

results = super().map(partial(_process_chunk, fn),
_get_chunks(*iterables, chunksize=chunksize),
itertools.batched(zip(*iterables), chunksize),
timeout=timeout)
return _chain_from_iterable_of_lists(results)

Expand Down