Skip to content

Commit

Permalink
Fix compilation with CPython 3.12a6
Browse files Browse the repository at this point in the history
CPython 3.12a6 made PyThreadState an opaque structure thus the fast
thread state optimization cannot be employed anymore.

Fixes cython#5286.
  • Loading branch information
dnicolodi committed Mar 27, 2023
1 parent 79b0451 commit 03ae300
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Cython/Utility/ModuleSetupCode.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@
#define CYTHON_UNPACK_METHODS 1
#endif
#ifndef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 1
// CPython 3.12a6 made PyThreadState an opaque struct.
#define CYTHON_FAST_THREAD_STATE (PY_VERSION_HEX < 0x030C00A6)
#endif
#ifndef CYTHON_FAST_GIL
// Py3<3.5.2 does not support _PyThreadState_UncheckedGet().
Expand Down

0 comments on commit 03ae300

Please sign in to comment.