예제 #1
0
파일: pipe.py 프로젝트: schlizbaeda/Sepperl
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
예제 #2
0
파일: pipe.py 프로젝트: chzhong/pyudev
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
예제 #3
0
 def __init__(self):
     """
     Create a new context.
     """
     self._libudev = load_ctypes_library('udev', SIGNATURES, ERROR_CHECKERS)
     self._as_parameter_ = self._libudev.udev_new()
예제 #4
0
파일: core.py 프로젝트: chzhong/pyudev
 def __init__(self):
     """
     Create a new context.
     """
     self._libudev = load_ctypes_library('udev', SIGNATURES, ERROR_CHECKERS)
     self._as_parameter_ = self._libudev.udev_new()