def write(self, payload):
    try:
      NailgunProtocol.write_chunk(self._socket, self._chunk_type, payload)
    except __HOLE__ as e:
      # If the remote client disconnects and we try to perform a write (e.g. socket.send/sendall),
      # an 'error: [Errno 32] Broken pipe' exception can be thrown. Setting mask_broken_pipe=True
      # safeguards against this case (which is unexpected for most writers of sys.stdout etc) so
      # that we don't awkwardly interrupt the runtime by throwing this exception on writes to
      # stdout/stderr.
      if e.errno == errno.EPIPE and not self._mask_broken_pipe:
        raise
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/java/nailgun_io.py/NailgunStreamWriter.write