parameters: (argv, master_read=_read, stdin_read=_read)
return_statement: return os.waitpid(pid, 0)[1]
docstring: Create a spawned process.
docstring_summary: Create a spawned process.
docstring_tokens: Create a spawned process .
function: def spawn(argv, master_read=_read, stdin_read=_read):
      """Create a spawned process."""
      if type(argv) == type(''):
          argv = (argv,)
      pid, master_fd = fork()
      if pid == CHILD:
          os.execlp(argv[0], *argv)
      try:
          mode = tty.tcgetattr(STDIN_FILENO)
          tty.setraw(STDIN_FILENO)
          restore = 1
      except tty.error:    # This is the same as termios.error
          restore = 0
      try:
          _copy(master_fd, master_read, stdin_read)
      except OSError:
          if restore:
              tty.tcsetattr(STDIN_FILENO, tty.TCSAFLUSH, mode)
  
      os.close(master_fd)
      return os.waitpid(pid, 0)[1]
function_tokens: def spawn ( argv , master_read = _read , stdin_read = _read ) : if type ( argv ) == type ( '' ) : argv = ( argv , ) pid , master_fd = fork ( ) if pid == CHILD : os . execlp ( argv [ 0 ] , * argv ) try : mode = tty . tcgetattr ( STDIN_FILENO ) tty . setraw ( STDIN_FILENO ) restore = 1 except tty . error : # This is the same as termios.error restore = 0 try : _copy ( master_fd , master_read , stdin_read ) except OSError : if restore : tty . tcsetattr ( STDIN_FILENO , tty . TCSAFLUSH , mode ) os . close ( master_fd ) return os . waitpid ( pid , 0 ) [ 1 ]