##// END OF EJS Templates
merge with stable
Augie Fackler -
r38620:af8d8513 merge default
parent child Browse files
Show More
@@ -44,6 +44,7 b' from . import ('
44 _ERROR_INVALID_PARAMETER = 87
44 _ERROR_INVALID_PARAMETER = 87
45 _ERROR_BROKEN_PIPE = 109
45 _ERROR_BROKEN_PIPE = 109
46 _ERROR_INSUFFICIENT_BUFFER = 122
46 _ERROR_INSUFFICIENT_BUFFER = 122
47 _ERROR_NO_DATA = 232
47
48
48 # WPARAM is defined as UINT_PTR (unsigned type)
49 # WPARAM is defined as UINT_PTR (unsigned type)
49 # LPARAM is defined as LONG_PTR (signed type)
50 # LPARAM is defined as LONG_PTR (signed type)
@@ -406,6 +407,12 b' def peekpipe(pipe):'
406
407
407 return avail.value
408 return avail.value
408
409
410 def lasterrorwaspipeerror(err):
411 if err.errno != errno.EINVAL:
412 return False
413 err = _kernel32.GetLastError()
414 return err == _ERROR_BROKEN_PIPE or err == _ERROR_NO_DATA
415
409 def testpid(pid):
416 def testpid(pid):
410 '''return True if pid is still running or unable to
417 '''return True if pid is still running or unable to
411 determine, False otherwise'''
418 determine, False otherwise'''
@@ -173,7 +173,7 b' class winstdout(object):'
173 self.fp.write(s[start:end])
173 self.fp.write(s[start:end])
174 start = end
174 start = end
175 except IOError as inst:
175 except IOError as inst:
176 if inst.errno != 0:
176 if inst.errno != 0 and not win32.lasterrorwaspipeerror(inst):
177 raise
177 raise
178 self.close()
178 self.close()
179 raise IOError(errno.EPIPE, 'Broken pipe')
179 raise IOError(errno.EPIPE, 'Broken pipe')
@@ -182,7 +182,7 b' class winstdout(object):'
182 try:
182 try:
183 return self.fp.flush()
183 return self.fp.flush()
184 except IOError as inst:
184 except IOError as inst:
185 if inst.errno != errno.EINVAL:
185 if not win32.lasterrorwaspipeerror(inst):
186 raise
186 raise
187 raise IOError(errno.EPIPE, 'Broken pipe')
187 raise IOError(errno.EPIPE, 'Broken pipe')
188
188
General Comments 0
You need to be logged in to leave comments. Login now