aboutsummaryrefslogtreecommitdiffhomepage
path: root/bindings
diff options
context:
space:
mode:
authorGravatar Tomi Ollila <tomi.ollila@iki.fi>2013-06-25 17:36:56 +0300
committerGravatar Justus Winter <4winter@informatik.uni-hamburg.de>2013-07-09 08:38:42 +0200
commitacb079e35726cc421b6a314ab4f26d5eb92feaf1 (patch)
treeebca5b13d4a5f2f94c520e9b916a378fb8d0d757 /bindings
parentb60fb3309cca82dd2789f45ad9cccaacdc291089 (diff)
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.
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python/notmuch/globals.py6
1 files changed, 5 insertions, 1 deletions
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.")