Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions tests/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
FREE_THREADING = bool(sysconfig.get_config_var('Py_GIL_DISABLED'))
if sys.implementation.name == 'cpython':
if FREE_THREADING:
# FIXME: test the limited C API on Windows
TEST_LIMITED_C_API = (sys.version_info >= (3, 15)) and not MS_WINDOWS
TEST_LIMITED_C_API = (sys.version_info >= (3, 15))
else:
TEST_LIMITED_C_API = True
else:
Expand Down
20 changes: 17 additions & 3 deletions tests/test_pythoncapi_compat_cext.c
Original file line number Diff line number Diff line change
Expand Up @@ -2656,7 +2656,7 @@ module_exec(PyObject *module)


// On Python 3.15 and newer, use PySlot API
#if PY_VERSION_HEX >= 0x030F0000 && !defined(MS_WINDOWS)
#if PY_VERSION_HEX >= 0x030F0000

PyABIInfo_VAR(abi_info);

Expand All @@ -2670,14 +2670,28 @@ static PySlot module_slots[] = {
{0, 0, {0}, {0}}
};

#define INIT_FUNC CONCAT(PyModExport_, MODULE_NAME)
#define EXPORT_FUNC CONCAT(PyModExport_, MODULE_NAME)

PyMODEXPORT_FUNC
INIT_FUNC(void)
EXPORT_FUNC(void)
{
return module_slots;
}

#ifdef MS_WINDOWS
#define INIT_FUNC CONCAT(PyInit_, MODULE_NAME)

// Workaround for https://github.com/pypa/distutils/issues/387
// https://docs.python.org/3.16/howto/abi3t-migration.html#module-export-hook
PyMODINIT_FUNC
INIT_FUNC(void)
{
PyErr_SetString(PyExc_SystemError,
"PyInit_* called for module with PyModExport_*");
return NULL;
}
#endif

#else

static PyModuleDef_Slot module_slots[] = {
Expand Down
Loading