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.
This commit is contained in:
Tomi Ollila 2013-06-25 17:36:56 +03:00 committed by Justus Winter
parent b60fb3309c
commit acb079e357

View file

@ -22,6 +22,10 @@ from ctypes import CDLL, Structure, POINTER
#-----------------------------------------------------------------------------
#package-global instance of the notmuch library
try:
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.")