summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2018-10-23 16:47:27 +0100
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2018-10-25 15:43:52 +0100
commit5a187a1e897196d2ba3d07785dca3e024594604e (patch)
treeec2521dbdbac5122393d10c41e1f44c038f7e667
parente9c6db1e2c524ca651d923467e53416c12f145aa (diff)
downloadbuildstream-5a187a1e897196d2ba3d07785dca3e024594604e.tar.gz
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 <daniel.silverstone@codethink.co.uk>
-rw-r--r--buildstream/utils.py3
1 files changed, 2 insertions, 1 deletions
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()