def openpty():
 try:
  return os.openpty()
 except (AttributeError, OSError):
  pass
 (master_fd, slave_name) = _open_terminal()
 slave_fd = slave_open(slave_name)
 return (master_fd, slave_fd)

def openpty ( ) : try : return os . openpty ( ) except ( AttributeError , OSError ) : pass ( master_fd , slave_name ) = _open_terminal ( ) slave_fd = slave_open ( slave_name ) return ( master_fd , slave_fd )
openpty() -> open a pty master/slave pair .