summaryrefslogtreecommitdiff
path: root/mdbp
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2022-06-23 17:29:06 +0200
committerHelmut Grohne <helmut@subdivi.de>2022-06-23 17:29:46 +0200
commita3d803cb7b9161cf4177c65fc9059e8a7f346c92 (patch)
tree7f0a8fd3853e91a71051b22be6442acf021ab887 /mdbp
parent8d8008457c8f081dd209772beb10ef98fb29faea (diff)
downloadmdbp-a3d803cb7b9161cf4177c65fc9059e8a7f346c92.tar.gz
mmdebstrap: use Popen as a context manager
Diffstat (limited to 'mdbp')
-rw-r--r--mdbp/mmdebstrap.py11
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()