diff options
author | Maxim Devaev <[email protected]> | 2021-12-24 14:10:08 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2021-12-24 14:10:08 +0300 |
commit | 3c029a6c46924e6418b7d6631f1f8d4696a804d5 (patch) | |
tree | b96632c1cba2a9c6f2520ca4826a920fabca9ad4 /kvmd | |
parent | 1e98d9bd5d63270e17d2b8cddd5820114c355aed (diff) |
using only find_library()
Diffstat (limited to 'kvmd')
-rw-r--r-- | kvmd/inotify.py | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/kvmd/inotify.py b/kvmd/inotify.py index e694961e..1bd43d61 100644 --- a/kvmd/inotify.py +++ b/kvmd/inotify.py @@ -48,22 +48,9 @@ from .logging import get_logger # ===== def _load_libc() -> ctypes.CDLL: - try: - path = ctypes.util.find_library("c") - except (OSError, IOError, RuntimeError): - pass - else: - if path: - return ctypes.CDLL(path) - - names = ["libc.so", "libc.so.6", "libc.so.0"] - for (index, name) in enumerate(names): - try: - return ctypes.CDLL(name) - except (OSError, IOError): - if index == len(names) - 1: - raise - + path = ctypes.util.find_library("c") + if path: + return ctypes.CDLL(path) raise RuntimeError("Where is libc?") |