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.
kid = SUB.Popen(command, stdout = SUB.PIPE)
try:
out = kid.stdout.readline()
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 \
finally:
kid.stdout.close()
if junk != '': raise ValueError \