safely close handles

This commit is contained in:
Anthony Scopatz 2016-11-07 11:48:59 -05:00
parent 45edaa62f2
commit 773e03d6c7

View file

@ -606,8 +606,8 @@ class PopenThread(threading.Thread):
if self.suspended:
return
# close files to send EOF to non-blocking reader.
self.orig_stdout.close()
self.orig_stderr.close()
safe_fdclose(self.orig_stdout)
safe_fdclose(self.orig_stderr)
# read in the remaining data in a blocking fashion.
while not procout.is_fully_read() or not procerr.is_fully_read():
self._read_write(procout, stdout, sys.__stdout__)