def writeSomeData(self, data):
"""Write some data to the open process.
"""
try:
rv = os.write(self.fd, data)
if rv == len(data) and self.enableReadHack:
self.startReading()
return rv
except IOError, io:
if io.args[0] == errno.EAGAIN:
return 0
return CONNECTION_LOST
except OSError, ose:
if ose.errno == errno.EPIPE:
return CONNECTION_LOST
if ose.errno == errno.EAGAIN: # MacOS-X does this
return 0
raise
评论列表
文章目录