From 39d381f91e93559011587d764c1895ee30efb741 Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Thu, 11 Apr 2024 13:49:52 -0400 Subject: gh-111506: Error if the limited API is used in free-threaded build (#117762) Issue a build time error if both `Py_LIMITED_API` and `Py_GIL_DISABLED` are defined. --- Include/Python.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Include/Python.h b/Include/Python.h index ca38a98..bb771fb 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -45,6 +45,11 @@ # endif #endif +// gh-111506: The free-threaded build is not compatible with the limited API +// or the stable ABI. +#if defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED) +# error "The limited API is not currently supported in the free-threaded build" +#endif // Include Python header files #include "pyport.h" -- cgit v0.12