--- a/mercurial/windows.py Tue Jul 03 12:10:22 2018 -0400
+++ b/mercurial/windows.py Wed Jul 04 14:19:13 2018 +0200
@@ -172,7 +172,7 @@
self.fp.write(s[start:end])
start = end
except IOError as inst:
- if inst.errno != 0:
+ if inst.errno != 0 and not win32.lasterrorwaspipeerror(inst):
raise
self.close()
raise IOError(errno.EPIPE, 'Broken pipe')
@@ -181,7 +181,7 @@
try:
return self.fp.flush()
except IOError as inst:
- if inst.errno != errno.EINVAL:
+ if not win32.lasterrorwaspipeerror(inst):
raise
raise IOError(errno.EPIPE, 'Broken pipe')