def write(self, b): if self._write_watcher is None: raise UnsupportedOperation('write') while True: try: return _write(self._fileno, b) except (IOError, OSError) as ex: if ex.args[0] not in ignored_errors: raise wait_on_watcher(self._write_watcher, None, None, self.hub)
def __read(self, n): if self._read_watcher is None: raise UnsupportedOperation('read') while 1: try: return _read(self._fileno, n) except (IOError, OSError) as ex: if ex.args[0] not in ignored_errors: raise wait_on_watcher(self._read_watcher, None, None, self.hub)