diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index fd2f2c3fff8282..026f4c357bf923 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -833,6 +833,10 @@ Build Changes :ref:`debug build `. (Contributed by Victor Stinner in :gh:`108634`.) +* The ``_stat`` C extension is now built with the :ref:`limited C API + `. + (Contributed by Victor Stinner in :gh:`85283`.) + C API Changes ============= diff --git a/Misc/NEWS.d/next/Build/2023-08-29-15-05-09.gh-issue-85283.tlK7G7.rst b/Misc/NEWS.d/next/Build/2023-08-29-15-05-09.gh-issue-85283.tlK7G7.rst new file mode 100644 index 00000000000000..09b56610e3c23d --- /dev/null +++ b/Misc/NEWS.d/next/Build/2023-08-29-15-05-09.gh-issue-85283.tlK7G7.rst @@ -0,0 +1,2 @@ +The ``_stat`` C extension is now built with the :ref:`limited C API +`. Patch by Victor Stinner. diff --git a/Modules/_stat.c b/Modules/_stat.c index 6cea26175dee5e..b972b5cbef3a2e 100644 --- a/Modules/_stat.c +++ b/Modules/_stat.c @@ -8,9 +8,11 @@ * as int 0. * * NOTE: POSIX only defines the values of the S_I* permission bits. - * */ +// Need limited C API version 3.13 for PyModule_Add() on Windows +#define Py_LIMITED_API 0x030d0000 + #include "Python.h" #ifdef __cplusplus