chiark
/
gitweb
/
~mdw
/
cfd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab5cf08
)
mdwsetup.py (progoutput): Explicitly close the `stdout' pipe.
author
Mark Wooding
<mdw@distorted.org.uk>
Fri, 4 Oct 2019 15:10:50 +0000
(16:10 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Fri, 8 May 2020 11:30:13 +0000
(12:30 +0100)
mdwsetup.py
patch
|
blob
|
blame
|
history
diff --git
a/mdwsetup.py
b/mdwsetup.py
index 06990a8cc1eaefdcad9a27effa27e8ca4941da41..57832a2d20e5a9727d77ec913c2c57d407b349ed 100644
(file)
--- 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()