diff options
author | Jesse Noller <jnoller@gmail.com> | 2009-07-16 14:23:04 (GMT) |
---|---|---|
committer | Jesse Noller <jnoller@gmail.com> | 2009-07-16 14:23:04 (GMT) |
commit | 7530e47948446f03a79ad7dec4cc129ad3388418 (patch) | |
tree | 92d29c2f72031fb5a2873b2a84f9277e05113e41 /Lib/multiprocessing | |
parent | 2e1285baee121bd0afc3fe0176b04ea5fbe8cd49 (diff) | |
download | cpython-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.py | 2 |
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) |