From af8a442b622bfdbdc6f6c0aff7d1ad4b3cad40d4 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 28 Sep 2024 12:32:59 +0200 Subject: [PATCH] fix: load libudev by linker name (#31) --- scc/lib/eudevmonitor.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scc/lib/eudevmonitor.py b/scc/lib/eudevmonitor.py index 5f0cec0e..7b2c74e7 100644 --- a/scc/lib/eudevmonitor.py +++ b/scc/lib/eudevmonitor.py @@ -32,11 +32,12 @@ class Eudev: def __init__(self) -> None: self._ctx = None try: - self._lib = ctypes.cdll.LoadLibrary("libudev.so") + self._lib = ctypes.cdll.LoadLibrary("libudev.so.1") except OSError: - self._lib = ctypes.CDLL(find_library(self.LIB_NAME)) - if self._lib is None: + lib_name = find_library(self.LIB_NAME) + if lib_name is None: raise ImportError("No library named udev") + self._lib = ctypes.CDLL(lib_name) Eudev._setup_lib(self._lib) self._ctx = self._lib.udev_new() if self._ctx is None: