From 73a003f646aea723201f85b858991828f9053d2c Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 18 Oct 2023 01:07:12 +0200 Subject: gh-85283: Build _uuid extension with limited C API (#111010) --- Doc/whatsnew/3.13.rst | 4 ++-- Misc/NEWS.d/next/Build/2023-10-17-01-56-11.gh-issue-85283.V156T2.rst | 4 ++-- Modules/_uuidmodule.c | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 54f007f..e5f01fa 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 cd26f7b..49b5da3 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 2f5be1c..b35cccb 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 -- cgit v0.12