From f3c13bfa1db49e33489169ac92153e7a7d1c3110 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Fri, 4 Oct 2019 16:10:50 +0100 Subject: [PATCH] mdwsetup.py (progoutput): Explicitly close the `stdout' pipe. --- mdwsetup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mdwsetup.py b/mdwsetup.py index 06990a8..57832a2 100644 --- a/mdwsetup.py +++ b/mdwsetup.py @@ -74,8 +74,11 @@ def progoutput(command): status zero. """ kid = SUB.Popen(command, stdout = SUB.PIPE) - out = kid.stdout.readline() - junk = kid.stdout.read() + try: + out = kid.stdout.readline() + junk = kid.stdout.read() + finally: + kid.stdout.close() if junk != '': raise ValueError \ ("Child process `%s' produced unspected output %r" % (command, junk)) rc = kid.wait() -- 2.11.0