commit | 7530e47948446f03a79ad7dec4cc129ad3388418 | [log] [tgz] |
---|---|---|
author | Jesse Noller <jnoller@gmail.com> | Thu Jul 16 14:23:04 2009 +0000 |
committer | Jesse Noller <jnoller@gmail.com> | Thu Jul 16 14:23:04 2009 +0000 |
tree | 92d29c2f72031fb5a2873b2a84f9277e05113e41 | |
parent | 2e1285baee121bd0afc3fe0176b04ea5fbe8cd49 [diff] [blame] |
Issue 6433: multiprocessing.pool.map hangs on empty list
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 @@ 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)