summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2024-04-11 17:49:52 (GMT)
committerGitHub <noreply@github.com>2024-04-11 17:49:52 (GMT)
commit39d381f91e93559011587d764c1895ee30efb741 (patch)
tree85f8d86fbb2820a0efc03eba943e89e1f72ff662
parentc06be6bbb8d138dde50c0a07cbd64496bee537c5 (diff)
downloadcpython-39d381f91e93559011587d764c1895ee30efb741.zip
cpython-39d381f91e93559011587d764c1895ee30efb741.tar.gz
cpython-39d381f91e93559011587d764c1895ee30efb741.tar.bz2
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.
-rw-r--r--Include/Python.h5
1 files changed, 5 insertions, 0 deletions
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"