Error in example in multiprocessing

Terry Reedy tjreedy at
Thu Jul 24 01:07:43 CEST 2014

On 7/23/2014 6:27 AM, Akshay Verma wrote:
> Example under
> Using a pool of workers
>       <>
> Has a error. As far as I understand, The input to res sleep function
> should be List and not integer.
> res  =  pool.apply_async(sleep,  10)

You are correct. Running the example results in
Traceback (most recent call last):
   File "C:\Programs\Python34\lib\multiprocessing\", line 119, in 
     result = (True, func(*args, **kwds))
TypeError: sleep() argument after * must be a sequence, not int

Changing 10 to [10] and the Exception is the expected TimeoutError
I am fixing this now.

Terry Jan Reedy

More information about the Python-list mailing list