FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Enable limited C API tests on Python 3.15 on Windows by vstinner · Pull Request #185 · python/pythoncapi-compat · GitHub

Repository navigation

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

Filter by extension

Filter by extension .c  (1) .py  (1) All 2 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
3 changes: 1 addition & 2 deletions tests/setup.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL