(master_fd, master_read=_read, stdin_read=_read)
Parent copy loop.
    Copies
            pty master -> standard output   (master_read)
            standard input -> pty master    (stdin_read)
Parent copy loop.
    Copies
            pty master -> standard output   (master_read)
            standard input -> pty master    (stdin_read)
Parent copy loop . Copies pty master - > standard output ( master_read ) standard input - > pty master ( stdin_read )
def _copy(master_fd, master_read=_read, stdin_read=_read):
    """Parent copy loop.
    Copies
            pty master -> standard output   (master_read)
            standard input -> pty master    (stdin_read)"""
    fds = [master_fd, STDIN_FILENO]
    while True:
        rfds, wfds, xfds = select(fds, [], [])
        if master_fd in rfds:
            data = master_read(master_fd)
            if not data:  # Reached EOF.
                fds.remove(master_fd)
            else:
                os.write(STDOUT_FILENO, data)
        if STDIN_FILENO in rfds:
            data = stdin_read(STDIN_FILENO)
            if not data:
                fds.remove(STDIN_FILENO)
            else:
                _writen(master_fd, data)
def _copy ( master_fd , master_read = _read , stdin_read = _read ) : fds = [ master_fd , STDIN_FILENO ] while True : rfds , wfds , xfds = select ( fds , [ ] , [ ] ) if master_fd in rfds : data = master_read ( master_fd ) if not data : # Reached EOF. fds . remove ( master_fd ) else : os . write ( STDOUT_FILENO , data ) if STDIN_FILENO in rfds : data = stdin_read ( STDIN_FILENO ) if not data : fds . remove ( STDIN_FILENO ) else : _writen ( master_fd , data )