gh-137956: Guard against non-free-threaded extensions in free-threaded builds (GH-137957)

This commit is contained in:
Petr Viktorin 2025-09-15 13:24:16 +02:00 committed by GitHub
parent aa9ceb1721
commit 32b2c5de16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 58 additions and 0 deletions

View file

@ -71,6 +71,8 @@ whose size is determined when the object is allocated.
*
* Statically allocated objects might be shared between
* interpreters, so must be marked as immortal.
*
* Before changing this, see the check in PyModuleDef_Init().
*/
#if defined(Py_GIL_DISABLED)
#define PyObject_HEAD_INIT(type) \
@ -634,6 +636,7 @@ given type object has a specified feature.
// Flag values for ob_flags (16 bits available, if SIZEOF_VOID_P > 4).
#define _Py_IMMORTAL_FLAGS (1 << 0)
#define _Py_LEGACY_ABI_CHECK_FLAG (1 << 1) /* see PyModuleDef_Init() */
#define _Py_STATICALLY_ALLOCATED_FLAG (1 << 2)
#if defined(Py_GIL_DISABLED) && defined(Py_DEBUG)
#define _Py_TYPE_REVEALED_FLAG (1 << 3)