From: Victor Stinner Date: Tue, 17 Oct 2023 23:07:12 +0000 (+0200) Subject: gh-85283: Build _uuid extension with limited C API (#111010) X-Git-Tag: v3.13.0a2~423 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=73a003f646aea723201f85b858991828f9053d2c;p=thirdparty%2FPython%2Fcpython.git gh-85283: Build _uuid extension with limited C API (#111010) --- diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 54f007f7d125..e5f01fa2df35 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -933,8 +933,8 @@ Build Changes library, GCC built-in atomic functions, or MSVC interlocked intrinsics. * The ``errno``, ``md5``, ``resource``, ``winsound``, ``_ctypes_test``, - ``_scproxy``, ``_stat`` and ``_testimportmultiple`` C extensions are now - built with the :ref:`limited C API `. + ``_scproxy``, ``_stat``, ``_testimportmultiple`` and ``_uuid`` 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 index cd26f7be2883..49b5da32f8f7 100644 --- 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 @@ -1,4 +1,4 @@ The ``errno``, ``md5``, ``resource``, ``winsound``, ``_ctypes_test``, -``_scproxy``, ``_stat`` and ``_testimportmultiple`` C extensions are now built -with the :ref:`limited C API `. +``_scproxy``, ``_stat``, ``_testimportmultiple`` and ``_uuid`` C extensions are +now built with the :ref:`limited C API `. Patch by Victor Stinner. diff --git a/Modules/_uuidmodule.c b/Modules/_uuidmodule.c index 2f5be1c5144d..b35cccb5bdc4 100644 --- a/Modules/_uuidmodule.c +++ b/Modules/_uuidmodule.c @@ -3,6 +3,9 @@ * DCE compatible Universally Unique Identifier library. */ +// Need limited C API version 3.13 for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED +#define Py_LIMITED_API 0x030d0000 + #include "Python.h" #if defined(HAVE_UUID_H) // AIX, FreeBSD, libuuid with pkgconf