Skip to content

Commit 9cb8c52

Browse files
authored
pythongh-140485: Catch ChildProcessError in multiprocessing resource tracker (pythonGH-141132)
1 parent 46b58e1 commit 9cb8c52

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Lib/multiprocessing/resource_tracker.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,12 @@ def _stop_locked(
111111
close(self._fd)
112112
self._fd = None
113113

114-
_, status = waitpid(self._pid, 0)
114+
try:
115+
_, status = waitpid(self._pid, 0)
116+
except ChildProcessError:
117+
self._pid = None
118+
self._exitcode = None
119+
return
115120

116121
self._pid = None
117122

0 commit comments

Comments
 (0)