@@ -259,8 +259,14 @@ with an exception object::
259259
260260 static PyModuleDef_Slot spam_module_slots[] = {
261261 {Py_mod_exec, spam_module_exec},
262+ #ifdef Py_mod_multiple_interpreters
263+ // signal that this module can be imported in isolated subinterpreters
262264 {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
265+ #endif
266+ #ifdef Py_mod_gil
267+ // signal that this module supports running without an active GIL
263268 {Py_mod_gil, Py_MOD_GIL_NOT_USED},
269+ #endif
264270 {0, NULL}
265271 };
266272
@@ -829,8 +835,12 @@ Philbrick (philbrick@hks.com)::
829835 };
830836
831837 static PyModuleDef_Slot keywdarg_slots[] = {
838+ #ifdef Py_mod_multiple_interpreters
832839 {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
840+ #endif
841+ #ifdef Py_mod_gil
833842 {Py_mod_gil, Py_MOD_GIL_NOT_USED},
843+ #endif
834844 {0, NULL}
835845 };
836846
@@ -1333,8 +1343,12 @@ function must take care of initializing the C API pointer array::
13331343
13341344 static PyModuleDef_Slot spam_module_slots[] = {
13351345 {Py_mod_exec, spam_module_exec},
1346+ #ifdef Py_mod_multiple_interpreters
13361347 {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
1348+ #endif
1349+ #ifdef Py_mod_gil
13371350 {Py_mod_gil, Py_MOD_GIL_NOT_USED},
1351+ #endif
13381352 {0, NULL}
13391353 };
13401354
@@ -1412,8 +1426,12 @@ like this::
14121426
14131427 static PyModuleDef_Slot client_module_slots[] = {
14141428 {Py_mod_exec, client_module_exec},
1429+ #ifdef Py_mod_multiple_interpreters
14151430 {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
1431+ #endif
1432+ #ifdef Py_mod_gil
14161433 {Py_mod_gil, Py_MOD_GIL_NOT_USED},
1434+ #endif
14171435 {0, NULL}
14181436 };
14191437
0 commit comments