From d034b32f57013a1224b3b7c27789f7c285047011 Mon Sep 17 00:00:00 2001 From: Florent Xicluna Date: Mon, 8 Mar 2010 11:01:39 +0000 Subject: [PATCH] On finalize, don't try to join not started process. --- Lib/multiprocessing/pool.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py index 2a8fae1c6a..8555da965f 100644 --- a/Lib/multiprocessing/pool.py +++ b/Lib/multiprocessing/pool.py @@ -447,12 +447,10 @@ class Pool(object): if pool and hasattr(pool[0], 'terminate'): debug('joining pool workers') for p in pool: - p.join() - for w in pool: - if w.exitcode is None: + if p.is_alive(): # worker has not yet exited - debug('cleaning up worker %s' % w.pid) - w.join() + debug('cleaning up worker %d' % p.pid) + p.join() # # Class whose instances are returned by `Pool.apply_async()` -- 2.40.0