Skip to content

Commit 81ebe07

Browse files
committed
Simplify kill_process_group()
1 parent 665bb1d commit 81ebe07

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

Lib/test/test_dtrace.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,7 @@ def create_process_group(*args, **kwargs):
5959
return subprocess.Popen(*args, **kwargs)
6060

6161
def kill_process_group(proc):
62-
use_killpg = USE_PROCESS_GROUP
63-
if use_killpg:
64-
parent_sid = os.getsid(0)
65-
sid = os.getsid(proc.pid)
66-
use_killpg = (sid != parent_sid)
67-
68-
if use_killpg:
62+
if USE_PROCESS_GROUP:
6963
os.killpg(proc.pid, signal.SIGKILL)
7064
else:
7165
proc.kill()

0 commit comments

Comments
 (0)