From 407949994bcd8f827a0963592018a65c9cc8a9e4 Mon Sep 17 00:00:00 2001 From: SVN-Git Migration Date: Thu, 8 Oct 2015 13:29:41 -0700 Subject: Hardcode the libudev SONAME that the package depends on. This makes sure that we don't load an untested ABI. Bu-Debian: https://bugs.debian.org/722573 Patch-Name: libudev_loading.diff --- src/pyudev/_ctypeslib/utils.py | 5 ++++- src/pyudev/core.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) Index: pyudev/src/pyudev/_ctypeslib/utils.py =================================================================== --- pyudev.orig/src/pyudev/_ctypeslib/utils.py +++ pyudev/src/pyudev/_ctypeslib/utils.py @@ -46,7 +46,10 @@ def load_ctypes_library(name, signatures :rtype: ctypes.CDLL :raises ImportError: if the library is not found """ - library_name = find_library(name) + if ".so" in name: + library_name = name + else: + library_name = find_library(name) if not library_name: raise ImportError(f"No library named {name}") lib = CDLL(library_name, use_errno=True) Index: pyudev/src/pyudev/core.py =================================================================== --- pyudev.orig/src/pyudev/core.py +++ pyudev/src/pyudev/core.py @@ -56,7 +56,7 @@ class Context: """ Create a new context. """ - self._libudev = load_ctypes_library("udev", SIGNATURES, ERROR_CHECKERS) + self._libudev = load_ctypes_library('libudev.so.1', SIGNATURES, ERROR_CHECKERS) self._as_parameter_ = self._libudev.udev_new() def __del__(self):