From bdea5780e50ea5c76cbd9b585db10e7382520253 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sat, 26 Aug 2023 02:10:05 +0200 Subject: [PATCH] gh-85283: _testimportmultiple uses the limited C API The _testimportmultiple C extension is now built with the limited C API. --- .../next/C API/2023-08-26-02-11-01.gh-issue-85283.RzMWia.rst | 2 ++ Modules/_testimportmultiple.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/C API/2023-08-26-02-11-01.gh-issue-85283.RzMWia.rst diff --git a/Misc/NEWS.d/next/C API/2023-08-26-02-11-01.gh-issue-85283.RzMWia.rst b/Misc/NEWS.d/next/C API/2023-08-26-02-11-01.gh-issue-85283.RzMWia.rst new file mode 100644 index 00000000000000..dc177bcf508e6e --- /dev/null +++ b/Misc/NEWS.d/next/C API/2023-08-26-02-11-01.gh-issue-85283.RzMWia.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 1caeb66eb8c858..7a24146cb55ba9 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,