Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions src/buildstream/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
#
# Authors:
# Tristan Van Berkom <tristan.vanberkom@codethink.co.uk>

# Disable this for the file, because pylint is not picking it up
# when specifying it on the specific line.
#
# pylint: disable=subprocess-popen-preexec-fn
#
"""
Utilities
=========
Expand Down Expand Up @@ -1260,14 +1254,7 @@ def _call(*popenargs, terminate=False, **kwargs):

process = None

old_preexec_fn = kwargs.get("preexec_fn")
if "preexec_fn" in kwargs:
del kwargs["preexec_fn"]

def preexec_fn():
os.umask(stat.S_IWGRP | stat.S_IWOTH)
if old_preexec_fn is not None:
old_preexec_fn()
kwargs.setdefault("umask", stat.S_IWGRP | stat.S_IWOTH)

# Handle termination, suspend and resume
def kill_proc():
Expand Down Expand Up @@ -1313,7 +1300,7 @@ def resume_proc():
os.killpg(group_id, signal.SIGCONT)

with _signals.suspendable(suspend_proc, resume_proc), _signals.terminator(kill_proc), subprocess.Popen(
*popenargs, preexec_fn=preexec_fn, universal_newlines=True, **kwargs
*popenargs, universal_newlines=True, **kwargs
) as process:
# Here, we don't use `process.communicate()` directly without a timeout
# This is because, if we were to do that, and the process would never
Expand Down
Loading