Skip to content

Commit

Permalink
pythongh-111506: Error if the limited API is used in free-threaded bu…
Browse files Browse the repository at this point in the history
…ild (python#117762)

Issue a build time error if both `Py_LIMITED_API` and `Py_GIL_DISABLED`
are defined.
  • Loading branch information
colesbury authored and diegorusso committed Apr 17, 2024
1 parent 4c350d2 commit 0e27fe7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Include/Python.h
Expand Up @@ -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"
Expand Down

0 comments on commit 0e27fe7

Please sign in to comment.