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 Apr 11, 2024
1 parent c06be6b commit 39d381f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Include/Python.h
Original file line number Diff line number Diff line change
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 39d381f

Please sign in to comment.