Issue #12285: multiprocessing.Pool() raises a ValueError if the number of

processes if negative or null.
This commit is contained in:
Victor Stinner 2011-06-20 17:54:33 +02:00
parent 3fdf9d43e5
commit f64a0cffca
2 changed files with 5 additions and 0 deletions

View file

@ -125,6 +125,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')