Package portage :: Package util :: Module _pty
[hide private]

Module _pty

source code

Functions [hide private]
tuple
_create_pty_or_pipe(copy_term_size=None)
Try to create a pty and if then fails then create a normal pipe instead.
source code
Variables [hide private]
  _disable_openpty = False
  _fbsd_test_pty = False
  __package__ = 'portage.util'

Imports: platform, pty, termios, os, get_term_size, set_term_size, writemsg


Function Details [hide private]

_create_pty_or_pipe(copy_term_size=None)

source code 

Try to create a pty and if then fails then create a normal pipe instead.

Parameters:
  • copy_term_size (int) - If a tty file descriptor is given then the term size will be copied to the pty.
Returns: tuple
A tuple of (is_pty, master_fd, slave_fd) where is_pty is True if a pty was successfully allocated, and False if a normal pipe was allocated.