Skip to content

Commit 68c129b

Browse files
committed
attempt to declare subinterpreter compatibility
not sure what's involved here
1 parent b184fed commit 68c129b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ if (NOT PYZMQ_BACKEND)
406406
set(PYZMQ_BACKEND "cffi")
407407
else()
408408
set(PYZMQ_BACKEND "cython")
409+
add_compile_definitions(CYTHON_USE_MODULE_STATE=1)
409410
endif()
410411
endif()
411412

zmq/backend/cython/_zmq.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# cython: language_level = 3str
22
# cython: freethreading_compatible = True
3+
# cython: subinterpreters_compatible = own_gil
4+
35
"""Cython backend for pyzmq"""
46

57
# Copyright (C) PyZMQ Developers
@@ -49,6 +51,7 @@
4951
cfunc,
5052
char,
5153
declare,
54+
exceptval,
5255
inline,
5356
nogil,
5457
p_char,
@@ -169,7 +172,7 @@
169172

170173
@cfunc
171174
@inline
172-
@C.exceptval(-1)
175+
@exceptval(-1)
173176
def _check_rc(rc: C.int, error_without_errno: bint = False) -> C.int:
174177
"""internal utility for checking zmq return condition
175178
@@ -1804,6 +1807,7 @@ def proxy_steerable(
18041807
@cfunc
18051808
@inline
18061809
@nogil
1810+
@exceptval(check=False)
18071811
def _mq_relay(
18081812
in_socket: p_void,
18091813
out_socket: p_void,
@@ -1887,6 +1891,7 @@ def _mq_relay(
18871891
@cfunc
18881892
@inline
18891893
@nogil
1894+
@exceptval(check=False)
18901895
def _mq_inline(
18911896
in_socket: p_void,
18921897
out_socket: p_void,

0 commit comments

Comments
 (0)