chiark / gitweb /
mdwsetup.py (progoutput): Explicitly close the `stdout' pipe.
[runlisp] / mdwsetup.py
index 06990a8cc1eaefdcad9a27effa27e8ca4941da41..57832a2d20e5a9727d77ec913c2c57d407b349ed 100644 (file)
@@ -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()