diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-20 15:54:03 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-20 15:54:03 (GMT) |
commit | 395dc58ee784087547115b684b2b39f40655ac47 (patch) | |
tree | 2eec97f48e097ccf5b7be0e08f8f1c223ed8ae19 /Lib/multiprocessing | |
parent | fb25ba9b073ddcec602700484ff5fc2b1bea1a59 (diff) | |
parent | 2fae27b735f4d93c8a7789a7a98857e1ce3c7193 (diff) | |
download | cpython-395dc58ee784087547115b684b2b39f40655ac47.zip cpython-395dc58ee784087547115b684b2b39f40655ac47.tar.gz cpython-395dc58ee784087547115b684b2b39f40655ac47.tar.bz2 |
(merge 3.2) 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.py | 2 |
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') |