def _get_pipe2_implementation(): """Find the appropriate implementation for ``pipe2``. Return a function implementing ``pipe2``.""" if hasattr(os, 'pipe2'): return os.pipe2 # pylint: disable=no-member else: try: libc = load_ctypes_library("libc", SIGNATURES, ERROR_CHECKERS) return (partial(_pipe2_ctypes, libc) if hasattr(libc, 'pipe2') else _pipe2_by_pipe) except ImportError: return _pipe2_by_pipe
def __init__(self): """ Create a new context. """ self._libudev = load_ctypes_library('udev', SIGNATURES, ERROR_CHECKERS) self._as_parameter_ = self._libudev.udev_new()