]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111506: Error if the limited API is used in free-threaded build (#117762)
authorSam Gross <colesbury@gmail.com>
Thu, 11 Apr 2024 17:49:52 +0000 (13:49 -0400)
committerGitHub <noreply@github.com>
Thu, 11 Apr 2024 17:49:52 +0000 (13:49 -0400)
Issue a build time error if both `Py_LIMITED_API` and `Py_GIL_DISABLED`
are defined.

Include/Python.h

index ca38a98d8c4eca06f6090bc898bd06bac819c51f..bb771fb3aec980d2e6cc5550b601b41d6b576a77 100644 (file)
 #  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"