diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 08e7bea4fe2bf99..01f8208f3af3eab 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -932,8 +932,8 @@ Build Changes * Building CPython now requires a compiler with support for the C11 atomic library, GCC built-in atomic functions, or MSVC interlocked intrinsics. -* The ``_stat`` C extension is now built with the :ref:`limited C API - `. +* The ``_stat`` and ``_testimportmultiple`` C extensions are now built with the + :ref:`limited C API `. (Contributed by Victor Stinner in :gh:`85283`.) diff --git a/Misc/NEWS.d/next/Build/2023-10-17-01-56-11.gh-issue-85283.V156T2.rst b/Misc/NEWS.d/next/Build/2023-10-17-01-56-11.gh-issue-85283.V156T2.rst new file mode 100644 index 000000000000000..763e6b89d1ee66d --- /dev/null +++ b/Misc/NEWS.d/next/Build/2023-10-17-01-56-11.gh-issue-85283.V156T2.rst @@ -0,0 +1,2 @@ +The ``_testimportmultiple`` C extension is now built with the :ref:`limited +C API `. Patch by Victor Stinner. diff --git a/Modules/_testimportmultiple.c b/Modules/_testimportmultiple.c index 1caeb66eb8c8589..01c519b1c79ff46 100644 --- a/Modules/_testimportmultiple.c +++ b/Modules/_testimportmultiple.c @@ -3,7 +3,10 @@ * file (issue16421). This file defines 3 modules (_testimportmodule, * foo, bar), only the first one is called the same as the compiled file. */ -#include + +#define Py_LIMITED_API 0x030d0000 + +#include static struct PyModuleDef _testimportmultiple = { PyModuleDef_HEAD_INIT, @@ -54,4 +57,3 @@ static struct PyModuleDef _barmodule = { PyMODINIT_FUNC PyInit__testimportmultiple_bar(void){ return PyModule_Create(&_barmodule); } -