(argv, master_read=_read, stdin_read=_read)
return waitpid(pid, 0)[1]
Create a spawned process.
Create a spawned process.
Create a spawned process .
def spawn(argv, master_read=_read, stdin_read=_read):
    """Create a spawned process."""
    if type(argv) == type(''):
        argv = (argv,)
    sys.audit('pty.spawn', argv)

    pid, master_fd = fork()
    if pid == CHILD:
        os.execlp(argv[0], *argv)

    try:
        mode = tcgetattr(STDIN_FILENO)
        setraw(STDIN_FILENO)
        restore = True
    except tty.error:    # This is the same as termios.error
        restore = False

    try:
        _copy(master_fd, master_read, stdin_read)
    finally:
        if restore:
            tcsetattr(STDIN_FILENO, tty.TCSAFLUSH, mode)

    close(master_fd)
    return waitpid(pid, 0)[1]
def spawn ( argv , master_read = _read , stdin_read = _read ) : if type ( argv ) == type ( '' ) : argv = ( argv , ) sys . audit ( 'pty.spawn' , argv ) pid , master_fd = fork ( ) if pid == CHILD : os . execlp ( argv [ 0 ] , * argv ) try : mode = tcgetattr ( STDIN_FILENO ) setraw ( STDIN_FILENO ) restore = True except tty . error : # This is the same as termios.error restore = False try : _copy ( master_fd , master_read , stdin_read ) finally : if restore : tcsetattr ( STDIN_FILENO , tty . TCSAFLUSH , mode ) close ( master_fd ) return waitpid ( pid , 0 ) [ 1 ]