1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 17:19:20 +00:00

rt-tests: modernise subprocess: preexec_fn=os.setsid -> start_new_session=True

start_new_session was added to python3 subprocess in v3.2 and
is meant to take the place of the common use of preexec_fn to
call os.setsid() in the child - as done here.

Update to use the new equivalent.

(From OE-Core rev: 0ebb56ff192e9c6db2af83c37db3307a27fe822a)

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
André Draszik
2020-02-03 17:28:13 +00:00
committed by Richard Purdie
parent e4893d4830
commit 3bfe8cad83
+2 -2
View File
@@ -166,12 +166,12 @@ def start_stress(*args):
log(" Command: '", stress_cmd_str, "'")
log()
# preexec_fn=os.setsid causes stress to be executed in a separate
# start_new_session causes stress to be executed in a separate
# session, => it gets a new process group (incl. children). It
# can then be terminated using os.killpg in end_stress without
# terminating this script.
p = subprocess.Popen(stress_cmd, preexec_fn=os.setsid)
p = subprocess.Popen(stress_cmd, start_new_session=True)
return p