diff options
author | Helmut Grohne <helmut@subdivi.de> | 2022-06-23 17:29:06 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2022-06-23 17:29:46 +0200 |
commit | a3d803cb7b9161cf4177c65fc9059e8a7f346c92 (patch) | |
tree | 7f0a8fd3853e91a71051b22be6442acf021ab887 /mdbp/mmdebstrap.py | |
parent | 8d8008457c8f081dd209772beb10ef98fb29faea (diff) | |
download | mdbp-a3d803cb7b9161cf4177c65fc9059e8a7f346c92.tar.gz |
mmdebstrap: use Popen as a context manager
Diffstat (limited to 'mdbp/mmdebstrap.py')
-rw-r--r-- | mdbp/mmdebstrap.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/mdbp/mmdebstrap.py b/mdbp/mmdebstrap.py index cbb52a9..c2bf9d4 100644 --- a/mdbp/mmdebstrap.py +++ b/mdbp/mmdebstrap.py @@ -218,11 +218,12 @@ def main() -> None: if "sourcename" in build["input"] else ()), *build.get("extrarepositories", ()), ] - proc = subprocess.Popen(cmd, - stdout=None if enablelog else subprocess.DEVNULL, - stderr=subprocess.STDOUT if enablelog - else subprocess.DEVNULL) - sys.exit(proc.wait()) + with subprocess.Popen( + cmd, + stdout=None if enablelog else subprocess.DEVNULL, + stderr=subprocess.STDOUT if enablelog else subprocess.DEVNULL, + ) as proc: + sys.exit(proc.wait()) if __name__ == "__main__": main() |