From: Sam Gross Date: Thu, 11 Apr 2024 17:49:52 +0000 (-0400) Subject: gh-111506: Error if the limited API is used in free-threaded build (#117762) X-Git-Tag: v3.13.0b1~476 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=39d381f91e93559011587d764c1895ee30efb741;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Include/Python.h b/Include/Python.h index ca38a98d8c4e..bb771fb3aec9 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"