mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
23 lines
712 B
Diff
23 lines
712 B
Diff
diff --git a/scc/lib/eudevmonitor.py b/scc/lib/eudevmonitor.py
|
|
index 6c1bd18..182eff2 100644
|
|
--- a/scc/lib/eudevmonitor.py
|
|
+++ b/scc/lib/eudevmonitor.py
|
|
@@ -28,12 +28,11 @@ class Eudev:
|
|
|
|
def __init__(self):
|
|
self._ctx = None
|
|
- self._lib = ctypes.CDLL(find_library(self.LIB_NAME))
|
|
- if self._lib is None:
|
|
- # Alternative approach for NixOS
|
|
- try:
|
|
- self._lib = ctypes.cdll.LoadLibrary("libudev.so")
|
|
- except OSError:
|
|
+ try:
|
|
+ self._lib = ctypes.cdll.LoadLibrary("libudev.so")
|
|
+ except OSError:
|
|
+ self._lib = ctypes.CDLL(find_library(self.LIB_NAME))
|
|
+ if self._lib is None:
|
|
raise ImportError("No library named udev")
|
|
Eudev._setup_lib(self._lib)
|
|
self._ctx = self._lib.udev_new()
|