code: def _raise_if_error(self):
          
          retcode = self.process.poll()
          if retcode is not None and retcode != 0:
              message = self._stderr.read().strip()
              raise IOError(message)
docs: Raise IOError if process is not running anymore and the
          exit code is nonzero.