From acb079e35726cc421b6a314ab4f26d5eb92feaf1 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Tue, 25 Jun 2013 17:36:56 +0300 Subject: [PATCH] Python bindings: CDLL("libnotmuch.3.dylib") on Darwin Use os.uname() to check for 'Darwin' and load "libnotmuch.3.dylib" instead of "libnotmuch.so.3" if that is the case. --- bindings/python/notmuch/globals.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bindings/python/notmuch/globals.py b/bindings/python/notmuch/globals.py index c7632c32..2deb87cf 100644 --- a/bindings/python/notmuch/globals.py +++ b/bindings/python/notmuch/globals.py @@ -22,7 +22,11 @@ from ctypes import CDLL, Structure, POINTER #----------------------------------------------------------------------------- #package-global instance of the notmuch library try: - nmlib = CDLL("libnotmuch.so.3") + from os import uname + if uname()[0] == 'Darwin': + nmlib = CDLL("libnotmuch.3.dylib") + else: + nmlib = CDLL("libnotmuch.so.3") except: raise ImportError("Could not find shared 'notmuch' library.") -- 2.43.0