Skip to content

Commit cf9c25c

Browse files
authored
gh-85283: Build _testimportmultiple with limited C API (#110954)
1 parent 86559dd commit cf9c25c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Doc/whatsnew/3.13.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -932,8 +932,8 @@ Build Changes
932932
* Building CPython now requires a compiler with support for the C11 atomic
933933
library, GCC built-in atomic functions, or MSVC interlocked intrinsics.
934934

935-
* The ``_stat`` C extension is now built with the :ref:`limited C API
936-
<limited-c-api>`.
935+
* The ``_stat`` and ``_testimportmultiple`` C extensions are now built with the
936+
:ref:`limited C API <limited-c-api>`.
937937
(Contributed by Victor Stinner in :gh:`85283`.)
938938

939939

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The ``_testimportmultiple`` C extension is now built with the :ref:`limited
2+
C API <limited-c-api>`. Patch by Victor Stinner.

Modules/_testimportmultiple.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
* file (issue16421). This file defines 3 modules (_testimportmodule,
44
* foo, bar), only the first one is called the same as the compiled file.
55
*/
6-
#include<Python.h>
6+
7+
#define Py_LIMITED_API 0x030d0000
8+
9+
#include <Python.h>
710

811
static struct PyModuleDef _testimportmultiple = {
912
PyModuleDef_HEAD_INIT,
@@ -54,4 +57,3 @@ static struct PyModuleDef _barmodule = {
5457
PyMODINIT_FUNC PyInit__testimportmultiple_bar(void){
5558
return PyModule_Create(&_barmodule);
5659
}
57-

0 commit comments

Comments
 (0)