summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing/pool.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/multiprocessing/pool.py')
-rw-r--r--Lib/multiprocessing/pool.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py
index d3ecc9b..3489aea 100644
--- a/Lib/multiprocessing/pool.py
+++ b/Lib/multiprocessing/pool.py
@@ -387,7 +387,10 @@ class Pool(object):
if pool and hasattr(pool[0], 'terminate'):
debug('joining pool workers')
for p in pool:
- p.join()
+ if p.is_alive():
+ # worker has not yet exited
+ debug('cleaning up worker %d' % p.pid)
+ p.join()
#
# Class whose instances are returned by `Pool.apply_async()`