summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing
diff options
context:
space:
mode:
authorJesse Noller <jnoller@gmail.com>2009-07-16 14:23:04 (GMT)
committerJesse Noller <jnoller@gmail.com>2009-07-16 14:23:04 (GMT)
commit7530e47948446f03a79ad7dec4cc129ad3388418 (patch)
tree92d29c2f72031fb5a2873b2a84f9277e05113e41 /Lib/multiprocessing
parent2e1285baee121bd0afc3fe0176b04ea5fbe8cd49 (diff)
downloadcpython-7530e47948446f03a79ad7dec4cc129ad3388418.zip
cpython-7530e47948446f03a79ad7dec4cc129ad3388418.tar.gz
cpython-7530e47948446f03a79ad7dec4cc129ad3388418.tar.bz2
Issue 6433: multiprocessing.pool.map hangs on empty list
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r--Lib/multiprocessing/pool.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py
index bc7e8f1..b91b77d 100644
--- a/Lib/multiprocessing/pool.py
+++ b/Lib/multiprocessing/pool.py
@@ -207,6 +207,8 @@ class Pool(object):
chunksize, extra = divmod(len(iterable), len(self._pool) * 4)
if extra:
chunksize += 1
+ if len(iterable) == 0:
+ chunksize = 0
task_batches = Pool._get_tasks(func, iterable, chunksize)
result = MapResult(self._cache, chunksize, len(iterable), callback)