Skip to content

Commit ec714e4

Browse files
vstinnermiss-islington
authored andcommitted
pythongh-140485: Catch ChildProcessError in multiprocessing resource tracker (pythonGH-141132)
(cherry picked from commit 9cb8c52) Co-authored-by: Victor Stinner <[email protected]>
1 parent a9c0082 commit ec714e4

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
@@ -115,7 +115,12 @@ def _stop_locked(
115115
close(self._fd)
116116
self._fd = None
117117

118-
_, status = waitpid(self._pid, 0)
118+
try:
119+
_, status = waitpid(self._pid, 0)
120+
except ChildProcessError:
121+
self._pid = None
122+
self._exitcode = None
123+
return
119124

120125
self._pid = None
121126

0 commit comments

Comments
 (0)