File tree 3 files changed +9
-7
lines changed 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -84,13 +84,15 @@ struct PyModuleDef_Slot {
84
84
#define _Py_mod_LAST_SLOT 3
85
85
#endif
86
86
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
-
92
87
#endif /* New in 3.5 */
93
88
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
+
94
96
struct PyModuleDef {
95
97
PyModuleDef_Base m_base ;
96
98
const char * m_name ;
Original file line number Diff line number Diff line change 62
62
pass
63
63
*/
64
64
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
66
67
67
68
#include "Python.h"
68
69
#include <string.h>
Original file line number Diff line number Diff line change @@ -293,7 +293,6 @@ xx_modexec(PyObject *m)
293
293
294
294
static PyModuleDef_Slot xx_slots [] = {
295
295
{Py_mod_exec , xx_modexec },
296
- {Py_mod_multiple_interpreters , Py_MOD_PER_INTERPRETER_GIL_SUPPORTED },
297
296
{0 , NULL }
298
297
};
299
298
You can’t perform that action at this time.
0 commit comments