Skip to content

Commit af8a442

Browse files
fix: load libudev by linker name (kozec#31)
1 parent 3289a9d commit af8a442

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scc/lib/eudevmonitor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ class Eudev:
3232
def __init__(self) -> None:
3333
self._ctx = None
3434
try:
35-
self._lib = ctypes.cdll.LoadLibrary("libudev.so")
35+
self._lib = ctypes.cdll.LoadLibrary("libudev.so.1")
3636
except OSError:
37-
self._lib = ctypes.CDLL(find_library(self.LIB_NAME))
38-
if self._lib is None:
37+
lib_name = find_library(self.LIB_NAME)
38+
if lib_name is None:
3939
raise ImportError("No library named udev")
40+
self._lib = ctypes.CDLL(lib_name)
4041
Eudev._setup_lib(self._lib)
4142
self._ctx = self._lib.udev_new()
4243
if self._ctx is None:

0 commit comments

Comments
 (0)