tonysimpson / nanomsg-python

nanomsg wrapper for python with multiple backends (CPython and ctypes) should support 2/3 and Pypy
MIT License
381 stars 85 forks source link

Use .dynlib on macosx instead of .so to load the library #31

Closed nekopep closed 9 years ago

nekopep commented 9 years ago

Hello,

On mac osx (at least 10.9.5) nanomsg once installed had .dynlib extension. In current code, the python wrapper try to load .so file, without success. The code below correct the behaviour:

In _nanomsg_ctypes/init.py

if sys.platform in ('win32', 'cygwin'): _functype = ctypes.WINFUNCTYPE _lib = ctypes.windll.nanomsg elif sys.platform in ('darwin'): _functype = ctypes.CFUNCTYPE _lib = ctypes.cdll.LoadLibrary('libnanomsg.dynlib') else: _functype = ctypes.CFUNCTYPE _lib = ctypes.cdll.LoadLibrary('libnanomsg.so')

Regards, Laurent