bpo-18966: non-daemonic threads created by a multiprocessing.Process should be joined on exit (#3111)

* bpo-18966: non-daemonic threads created by a multiprocessing.Process should be joined on exit

* Add NEWS blurb
This commit is contained in:
Antoine Pitrou 2017-08-16 20:53:28 +02:00 committed by GitHub
parent 17657bb945
commit ee84a60858
4 changed files with 33 additions and 0 deletions

View file

@ -17,6 +17,7 @@ import os
import sys
import signal
import itertools
import threading
from _weakrefset import WeakSet
#
@ -311,6 +312,7 @@ class BaseProcess(object):
sys.stderr.write('Process %s:\n' % self.name)
traceback.print_exc()
finally:
threading._shutdown()
util.info('process exiting with exitcode %d' % exitcode)
sys.stdout.flush()
sys.stderr.flush()