Skip to content

Commit a2abf9d

Browse files
authored
Merge pull request #227 from benjaminp/find-library-abs
don't call ctypes.util.find_library on non-sonames
2 parents 583f939 + 43730cb commit a2abf9d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

iptc/util.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ def load_kernel(name, exc_if_failed=False):
5252

5353

5454
def _do_find_library(name):
55+
if '/' in name:
56+
try:
57+
return ctypes.CDLL(name, mode=ctypes.RTLD_GLOBAL)
58+
except Exception:
59+
return None
5560
p = ctypes.util.find_library(name)
5661
if p:
5762
lib = ctypes.CDLL(p, mode=ctypes.RTLD_GLOBAL)

0 commit comments

Comments
 (0)