Build: resolve errors & deprecation warnings with Python 3.14 beta

Python 3.14 has moved some functionality into the public API,
use the updated names even with older Python versions.

Also resolve an error caused by variable reuse with delayed annotation
evaluation for TextureProperties_MixIn on startup.

Resolve #140695.
This commit is contained in:
Campbell Barton
2025-06-20 04:19:35 +00:00
parent f3b0600083
commit 6197335658
50 changed files with 109 additions and 63 deletions

View File

@@ -5,6 +5,9 @@
/** \file
* \ingroup pygen
* \brief header-only compatibility defines.
*
* \note this header should not be removed/cleaned where Python is used.
* Because its required for Blender to build against different versions of Python.
*/
#pragma once
@@ -27,3 +30,11 @@
# define Py_IsFinalizing _Py_IsFinalizing
#endif
/* Python 3.14 made some changes, use the "new" names. */
#if PY_VERSION_HEX < 0x030e0000
# define Py_HashPointer _Py_HashPointer
# define PyThreadState_GetUnchecked _PyThreadState_UncheckedGet
/* TODO: Support: `PyDict_Pop`, it has different arguments. */
#endif