changeset: 85447:e99832a60e63 user: Richard Oudkerk date: Thu Aug 29 12:51:11 2013 +0100 files: Lib/test/regrtest.py description: Issue #8713: Cleanup before saving process._dangling. diff -r f6c7ad7d029a -r e99832a60e63 Lib/test/regrtest.py --- a/Lib/test/regrtest.py Thu Aug 29 12:41:19 2013 +0100 +++ b/Lib/test/regrtest.py Thu Aug 29 12:51:11 2013 +0100 @@ -1010,8 +1010,10 @@ 'os.environ', 'sys.path', 'sys.path_hooks', '__import__', 'warnings.filters', 'asyncore.socket_map', 'logging._handlers', 'logging._handlerList', 'sys.gettrace', - 'sys.warnoptions', 'threading._dangling', - 'multiprocessing.process._dangling', + 'sys.warnoptions', + # multiprocessing.process._cleanup() may release ref + # to a thread, so check processes first. + 'multiprocessing.process._dangling', 'threading._dangling', 'sysconfig._CONFIG_VARS', 'sysconfig._INSTALL_SCHEMES', 'support.TESTFN', 'locale', 'warnings.showwarning', ) @@ -1141,6 +1143,8 @@ def get_multiprocessing_process__dangling(self): if not multiprocessing: return None + # Unjoined process objects can survive after process exits + multiprocessing.process._cleanup() # This copies the weakrefs without making any strong reference return multiprocessing.process._dangling.copy() def restore_multiprocessing_process__dangling(self, saved):