File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -84,13 +84,15 @@ struct PyModuleDef_Slot {
8484#define _Py_mod_LAST_SLOT 3
8585#endif
8686
87- /* for Py_mod_multiple_interpreters: */
88- #define Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED ((void *)0)
89- #define Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED ((void *)1)
90- #define Py_MOD_PER_INTERPRETER_GIL_SUPPORTED ((void *)2)
91-
9287#endif /* New in 3.5 */
9388
89+ /* for Py_mod_multiple_interpreters: */
90+ #if !defined(Py_LIMITED_API ) || Py_LIMITED_API + 0 >= 0x030c0000
91+ # define Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED ((void *)0)
92+ # define Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED ((void *)1)
93+ # define Py_MOD_PER_INTERPRETER_GIL_SUPPORTED ((void *)2)
94+ #endif
95+
9496struct PyModuleDef {
9597 PyModuleDef_Base m_base ;
9698 const char * m_name ;
Original file line number Diff line number Diff line change 6262 pass
6363 */
6464
65- #define Py_LIMITED_API 0x030b0000
65+ // Need limited C API version 3.12 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED
66+ #define Py_LIMITED_API 0x030c0000
6667
6768#include "Python.h"
6869#include <string.h>
Original file line number Diff line number Diff line change @@ -293,7 +293,6 @@ xx_modexec(PyObject *m)
293293
294294static PyModuleDef_Slot xx_slots [] = {
295295 {Py_mod_exec , xx_modexec },
296- {Py_mod_multiple_interpreters , Py_MOD_PER_INTERPRETER_GIL_SUPPORTED },
297296 {0 , NULL }
298297};
299298
You can’t perform that action at this time.
0 commit comments