]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-140485: Catch ChildProcessError in multiprocessing resource tracker (GH-141132)
authorVictor Stinner <vstinner@python.org>
Tue, 11 Nov 2025 04:59:16 +0000 (05:59 +0100)
committerGitHub <noreply@github.com>
Tue, 11 Nov 2025 04:59:16 +0000 (20:59 -0800)
Lib/multiprocessing/resource_tracker.py

index c53092f6e34b322922fee78a036487048bfb652f..38fcaed48fa9fb608cb6be7a95dcb5b45be37de8 100644 (file)
@@ -111,7 +111,12 @@ class ResourceTracker(object):
         close(self._fd)
         self._fd = None
 
-        _, status = waitpid(self._pid, 0)
+        try:
+            _, status = waitpid(self._pid, 0)
+        except ChildProcessError:
+            self._pid = None
+            self._exitcode = None
+            return
 
         self._pid = None