summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-06-20 15:53:35 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-06-20 15:53:35 (GMT)
commit2fae27b735f4d93c8a7789a7a98857e1ce3c7193 (patch)
tree82049c5c1c54d684d81f979b201d9643d124a3ea /Lib/multiprocessing
parent4707a998e4a0a0587dd6265e0c8c64588ab23712 (diff)
downloadcpython-2fae27b735f4d93c8a7789a7a98857e1ce3c7193.zip
cpython-2fae27b735f4d93c8a7789a7a98857e1ce3c7193.tar.gz
cpython-2fae27b735f4d93c8a7789a7a98857e1ce3c7193.tar.bz2
Issue #12285: multiprocessing.Pool() raises a ValueError if the number of
processes if negative or null.
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 92170f2..e450319 100644
--- a/Lib/multiprocessing/pool.py
+++ b/Lib/multiprocessing/pool.py
@@ -148,6 +148,8 @@ class Pool(object):
processes = cpu_count()
except NotImplementedError:
processes = 1
+ if processes < 1:
+ raise ValueError("Number of processes must be at least 1")
if initializer is not None and not hasattr(initializer, '__call__'):
raise TypeError('initializer must be a callable')