Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Lib/test/libregrtest/run_workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,12 @@ def _kill(self) -> None:

use_killpg = USE_PROCESS_GROUP
if use_killpg:
parent_sid = os.getsid(0)
sid = os.getsid(popen.pid)
use_killpg = (sid != parent_sid)
try:
use_killpg = (os.getsid(popen.pid) != os.getsid(0))
except PermissionError:
# On OpenBSD getsid() is only allowed for a process in the
# same session, so the failure means that it is not.
use_killpg = True

if use_killpg:
what = f"{self} process group"
Expand Down
Loading