Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Compatibility with Mac OS X: choose dynamic library extension by

platform.
  • Loading branch information...
commit c8c8419360fff79fe3f2043bdffd96dec6e10c9f 1 parent 5d3690e
@smira smira authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  zmq/_zmq.py
View
3  zmq/_zmq.py
@@ -25,6 +25,7 @@
# <http://www.gnu.org/licenses/>.
import random
+import platform
# hack to avoid twisted tests failure
import py
@@ -93,7 +94,7 @@ def _check_zmq_errno(result, func, arguments):
raise ZMQError(errno)
return result
-libzmq = CDLL("libzmq.so", use_errno=True)
+libzmq = CDLL("libzmq" + (".dylib" if platform.system() == "Darwin" else ".so"), use_errno=True)
libzmq.zmq_version.restype = None
libzmq.zmq_version.argtypes = [POINTER(c_int)]*3

4 comments on commit c8c8419

@dholth

I believe ctypes has a find library function that takes 'zmq' and prepends, appends lib, .dylib, .so as necessary.

@smira
Collaborator

@dholth, it doesn't seem to work for me on Python 2.7 and Mac OS X:

E OSError: dlopen(zmq, 6): no suitable image found. Did find:
E zmq: not a file

@smira
Collaborator

Thanks, fixed in: 808c9ba

Please sign in to comment.
Something went wrong with that request. Please try again.