[oe-commits] [openembedded-core] 21/25: rt-tests: modernise subprocess: preexec_fn=os.setsid -> start_new_session=True
git at git.openembedded.org
git at git.openembedded.org
Tue Feb 4 15:57:20 UTC 2020
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master
in repository openembedded-core.
commit 0ebb56ff192e9c6db2af83c37db3307a27fe822a
Author: André Draszik <git at andred.net>
AuthorDate: Mon Feb 3 17:28:13 2020 +0000
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.
Signed-off-by: André Draszik <git at andred.net>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/recipes-rt/rt-tests/files/rt_bmark.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-rt/rt-tests/files/rt_bmark.py b/meta/recipes-rt/rt-tests/files/rt_bmark.py
index 57b39b5..3b84447 100755
--- a/meta/recipes-rt/rt-tests/files/rt_bmark.py
+++ b/meta/recipes-rt/rt-tests/files/rt_bmark.py
@@ -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
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list