diff options
-rw-r--r-- | Doc/whatsnew/3.13.rst | 4 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Build/2023-10-17-01-56-11.gh-issue-85283.V156T2.rst | 2 | ||||
-rw-r--r-- | Modules/_testimportmultiple.c | 6 |
3 files changed, 8 insertions, 4 deletions
diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 08e7bea..01f8208 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 - <limited-c-api>`. +* The ``_stat`` and ``_testimportmultiple`` C extensions are now built with the + :ref:`limited C API <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 0000000..763e6b8 --- /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 <limited-c-api>`. Patch by Victor Stinner. diff --git a/Modules/_testimportmultiple.c b/Modules/_testimportmultiple.c index 1caeb66..01c519b 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<Python.h> + +#define Py_LIMITED_API 0x030d0000 + +#include <Python.h> 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); } - |