code: def wait(self, timeout=-1):
          
          if self._process is None:
              raise RuntimeError('no child process')
          if timeout == -1:
              timeout = self._timeout
          if not self._child_exited.wait(timeout):
              raise Timeout('timeout waiting for child to exit')
          return self.returncode
docs: Wait for the child to exit.
  
          Wait for at most *timeout* seconds, or indefinitely if *timeout* is
          None. Return the value of the :attr:`returncode` attribute.