Skip to content

Commit

Permalink
fix: load libudev by linker name (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
git-developer authored Sep 28, 2024
1 parent 3289a9d commit af8a442
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scc/lib/eudevmonitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit af8a442

Please sign in to comment.