From 5a187a1e897196d2ba3d07785dca3e024594604e Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Tue, 23 Oct 2018 16:47:27 +0100 Subject: utils.py: Disable lint warning about popen We use `preexec_fn` in our use of Popen. Since there are threads in the codebase, this is not necessarily safe. However we go to great lengths to ensure that the main process doesn't spawn threads (they're used in gRPC a lot) and so it should be safe for our use. As such, we disable the lint here. Signed-off-by: Daniel Silverstone --- buildstream/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildstream/utils.py b/buildstream/utils.py index 7f2f9d5fd..949b97b70 100644 --- a/buildstream/utils.py +++ b/buildstream/utils.py @@ -1088,7 +1088,8 @@ def _call(*popenargs, terminate=False, **kwargs): os.killpg(group_id, signal.SIGCONT) with _signals.suspendable(suspend_proc, resume_proc), _signals.terminator(kill_proc): - process = subprocess.Popen(*popenargs, preexec_fn=preexec_fn, **kwargs) + process = subprocess.Popen( # pylint: disable=subprocess-popen-preexec-fn + *popenargs, preexec_fn=preexec_fn, **kwargs) output, _ = process.communicate() exit_code = process.poll() -- cgit v1.2.1