windows: do not close stdout on flush() failure

It's been there since 84af5a079c7d (2007-02-19), but seems wrong since any
I/O operations to a closed file would raise ValueError, not IOError. We should
keep the file object open even if the underlying file descriptor is half dead.
This commit is contained in:
Yuya Nishihara 2017-06-05 23:36:35 +09:00
parent 2a6bbffb41
commit 74b8d80dfc

View File

@ -180,7 +180,6 @@ class winstdout(object):
except IOError as inst:
if inst.errno != errno.EINVAL:
raise
self.close()
raise IOError(errno.EPIPE, 'Broken pipe')
def _is_win_9x():