From 038a010b916f3072215eac7be2546b04abebff91 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sun, 8 Nov 2026 14:50:23 +0100 Subject: [PATCH] gh-161609: Catch ProcessLookupError on os.getsid() in regrtest --- Lib/test/libregrtest/run_workers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/libregrtest/run_workers.py b/Lib/test/libregrtest/run_workers.py index ad02d8dba7c23e..7118a67a2336c6 100644 --- a/Lib/test/libregrtest/run_workers.py +++ b/Lib/test/libregrtest/run_workers.py @@ -153,6 +153,9 @@ def _kill(self) -> None: # On OpenBSD getsid() is only allowed for a process in the # same session, so the failure means that it is not. use_killpg = True + except ProcessLookupError: + # The process completed in the meanwhile + return if use_killpg: what = f"{self} process group"