From 79f0ec86ea38bf04e86687e603f246ea92a693b3 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Thu, 27 May 2021 19:20:58 +0200 Subject: prefer subprocess.call over subprocess.run Avoid pylint complaining and we don't need the CompletedProcess object. --- mdbp/sbuild.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'mdbp/sbuild.py') diff --git a/mdbp/sbuild.py b/mdbp/sbuild.py index 5309031..ba42932 100644 --- a/mdbp/sbuild.py +++ b/mdbp/sbuild.py @@ -90,18 +90,18 @@ def main() -> None: except KeyError: thing = str(stack.enter_context(get_dsc(build)).absolute()) - cproc = subprocess.run(["sbuild", thing], - env=dict(SBUILD_CONFIG=sbuildconf.name, - PATH="/usr/bin:/bin"), - cwd=build["output"]["directory"], - stdout=None if build["output"].get("log", True) - else subprocess.DEVNULL, - stderr=subprocess.STDOUT - if build["output"].get("log", True) - else subprocess.DEVNULL) + ret = subprocess.call(["sbuild", thing], + env=dict(SBUILD_CONFIG=sbuildconf.name, + PATH="/usr/bin:/bin"), + cwd=build["output"]["directory"], + stdout=None if build["output"].get("log", True) + else subprocess.DEVNULL, + stderr=subprocess.STDOUT + if build["output"].get("log", True) + else subprocess.DEVNULL) clean_dir(pathlib.Path(build["output"]["directory"]), build["output"].get("artifacts", ["*"])) - sys.exit(cproc.returncode) + sys.exit(ret) if __name__ == "__main__": main() -- cgit v1.2.3