diff options
author | Helmut Grohne <helmut@subdivi.de> | 2021-05-27 19:20:58 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2021-05-27 19:20:58 +0200 |
commit | 79f0ec86ea38bf04e86687e603f246ea92a693b3 (patch) | |
tree | fad8dda098ed1be5d678bd2f7d575ab76705b2c1 | |
parent | e0edc0277327629115aa31b415709cf87a723574 (diff) | |
download | mdbp-79f0ec86ea38bf04e86687e603f246ea92a693b3.tar.gz |
prefer subprocess.call over subprocess.run
Avoid pylint complaining and we don't need the CompletedProcess object.
-rw-r--r-- | .pylintrc | 2 | ||||
-rw-r--r-- | mdbp/pbuilder.py | 12 | ||||
-rw-r--r-- | mdbp/sbuild.py | 20 |
3 files changed, 16 insertions, 18 deletions
diff --git a/.pylintrc b/.pylintrc deleted file mode 100644 index fc2a971..0000000 --- a/.pylintrc +++ /dev/null @@ -1,2 +0,0 @@ -[MESSAGES CONTROL] -disable=subprocess-run-check diff --git a/mdbp/pbuilder.py b/mdbp/pbuilder.py index c2df394..a3eb228 100644 --- a/mdbp/pbuilder.py +++ b/mdbp/pbuilder.py @@ -79,14 +79,14 @@ runuser -u pbuilder -- lintian %s "${BUILDDIR:-/tmp/buildd}"/*.changes """ % (shlex.join(apt_get), shlex.join(build["lintian"].get("options", [])))) hook.chmod(0o755) cmd.extend(["--hookdir", hookdirn, str(dscpath)]) - cproc = subprocess.run(cmd, env=compute_env(build), - stdout=None if enablelog - else subprocess.DEVNULL, - stderr=subprocess.STDOUT if enablelog - else subprocess.DEVNULL) + ret = subprocess.call(cmd, env=compute_env(build), + stdout=None if enablelog + else subprocess.DEVNULL, + stderr=subprocess.STDOUT if enablelog + 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() 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() |