chiark
/
gitweb
/
~mdw
/
runlisp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
f3c13bf
)
mdwsetup.py (progoutput): Only read one byte to decide whether there is more.
author
Mark Wooding
<mdw@distorted.org.uk>
Fri, 4 Oct 2019 15:22:15 +0000
(16:22 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Fri, 8 May 2020 11:30:13 +0000
(12:30 +0100)
There's no point in slurping the entire output now that we're closing
the pipe /before/ trying to waitpid(2): the child will hit `SIGPIPE' (or
`EPIPE') rather than blocking on output.
mdwsetup.py
patch
|
blob
|
blame
|
history
diff --git
a/mdwsetup.py
b/mdwsetup.py
index 57832a2d20e5a9727d77ec913c2c57d407b349ed..0210714cbac542d91b5c525f14f851e23ecbbb89 100644
(file)
--- a/
mdwsetup.py
+++ b/
mdwsetup.py
@@
-76,7
+76,7
@@
def progoutput(command):
kid = SUB.Popen(command, stdout = SUB.PIPE)
try:
out = kid.stdout.readline()
- junk = kid.stdout.read()
+ junk = kid.stdout.read(
1
)
finally:
kid.stdout.close()
if junk != '': raise ValueError \