Skip to content

Commit

Permalink
Use ctypes.util.find_library to find library name.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Smirnov committed Jul 5, 2011
1 parent 385cdba commit 808c9ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zmq/_zmq.py
Expand Up @@ -25,14 +25,14 @@
# <http://www.gnu.org/licenses/>. # <http://www.gnu.org/licenses/>.


import random import random
import platform


# hack to avoid twisted tests failure # hack to avoid twisted tests failure
import py import py
import pytest import pytest
# #


from ctypes import * from ctypes import *
from ctypes.util import find_library
from ctypes_configure import configure from ctypes_configure import configure


class CConfigure(object): class CConfigure(object):
Expand Down Expand Up @@ -94,7 +94,7 @@ def _check_zmq_errno(result, func, arguments):
raise ZMQError(errno) raise ZMQError(errno)
return result return result


libzmq = CDLL("libzmq" + (".dylib" if platform.system() == "Darwin" else ".so"), use_errno=True) libzmq = CDLL(find_library("zmq"), use_errno=True)


libzmq.zmq_version.restype = None libzmq.zmq_version.restype = None
libzmq.zmq_version.argtypes = [POINTER(c_int)]*3 libzmq.zmq_version.argtypes = [POINTER(c_int)]*3
Expand Down

0 comments on commit 808c9ba

Please sign in to comment.