Skip to content

Commit 0e27fe7

Browse files
colesburydiegorusso
authored andcommitted
pythongh-111506: Error if the limited API is used in free-threaded build (python#117762)
Issue a build time error if both `Py_LIMITED_API` and `Py_GIL_DISABLED` are defined.
1 parent 4c350d2 commit 0e27fe7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Include/Python.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
# endif
4646
#endif
4747

48+
// gh-111506: The free-threaded build is not compatible with the limited API
49+
// or the stable ABI.
50+
#if defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED)
51+
# error "The limited API is not currently supported in the free-threaded build"
52+
#endif
4853

4954
// Include Python header files
5055
#include "pyport.h"

0 commit comments

Comments
 (0)