Skip to content

Commit 7a60063

Browse files
authored
Merge pull request #2083 from minrk/limited-fixes
extract fixes from limited api tests
2 parents 2c768db + 68af6a8 commit 7a60063

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

tools/install_libzmq.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ LIBZMQ_VERSION=$(python buildutils/bundle.py)
66
PYZMQ_DIR="$PWD"
77
LICENSE_DIR="$PYZMQ_DIR/licenses"
88
test -d "$LICENSE_DIR" || mkdir "$LICENSE_DIR"
9-
9+
SHLIB_EXT=".so"
1010
if [[ "$(uname)" == "Darwin" ]]; then
11+
SHLIB_EXT=".dylib"
1112
# make sure deployment target is set
1213
echo "${MACOSX_DEPLOYMENT_TARGET=}"
1314
test ! -z "${MACOSX_DEPLOYMENT_TARGET}"
@@ -44,6 +45,12 @@ if [[ "$(uname)" == "Darwin" ]]; then
4445
fi
4546

4647
PREFIX="${ZMQ_PREFIX:-/usr/local}"
48+
49+
if [ -f "$PREFIX/lib/libzmq${SHLIB_EXT}" ]; then
50+
echo "using $PREFIX/lib/libzmq${SHLIB_EXT}"
51+
exit 0
52+
fi
53+
4754
# add rpath so auditwheel patches it
4855
export LDFLAGS="${LDFLAGS} -Wl,-rpath,$PREFIX/lib"
4956

zmq/backend/cython/_zmq.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,20 @@
5757
size_t,
5858
sizeof,
5959
)
60-
from cython.cimports.cpython import (
61-
PyBytes_AsString,
62-
PyBytes_FromStringAndSize,
63-
PyBytes_Size,
64-
PyErr_CheckSignals,
65-
)
6660
from cython.cimports.cpython.buffer import (
6761
Py_buffer,
6862
PyBUF_ANY_CONTIGUOUS,
6963
PyBUF_WRITABLE,
7064
PyBuffer_Release,
7165
PyObject_GetBuffer,
7266
)
67+
from cython.cimports.cpython.bytes import (
68+
PyBytes_AsString,
69+
PyBytes_FromStringAndSize,
70+
PyBytes_Size,
71+
)
72+
from cython.cimports.cpython.exc import PyErr_CheckSignals
7373
from cython.cimports.libc.errno import EAGAIN, EINTR, ENAMETOOLONG, ENOENT, ENOTSOCK
74-
75-
# cimports require Cython 3
7674
from cython.cimports.libc.stdint import uint32_t
7775
from cython.cimports.libc.stdio import fprintf
7876
from cython.cimports.libc.stdio import stderr as cstderr
@@ -367,10 +365,10 @@ def __init__(
367365
_check_rc(rc)
368366
self._failed_init = False
369367

370-
def __del__(self):
368+
def __dealloc__(self):
371369
if self._failed_init:
372370
return
373-
# This simply decreases the 0MQ ref-count of zmq_msg.
371+
# decrease the 0MQ ref-count of zmq_msg
374372
with nogil:
375373
rc: C.int = zmq_msg_close(address(self.zmq_msg))
376374
_check_rc(rc)

zmq/utils/mutex.h

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
#pragma once
1111

12+
#include <stdlib.h>
13+
1214
#if defined(_WIN32)
1315
# include <windows.h>
1416
#else

0 commit comments

Comments
 (0)