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:
@@ -367,19 +367,19 @@ class TextureProperties_MixIn:
|
||||
description="How the image is extrapolated past its original bounds",
|
||||
)
|
||||
|
||||
t = bpy.types.Image.bl_rna.properties["alpha_mode"]
|
||||
_Image_alpha_mode = bpy.types.Image.bl_rna.properties["alpha_mode"]
|
||||
alpha_mode: EnumProperty(
|
||||
name=t.name,
|
||||
items=tuple((e.identifier, e.name, e.description) for e in t.enum_items),
|
||||
default=t.default,
|
||||
description=t.description,
|
||||
name=_Image_alpha_mode.name,
|
||||
items=tuple((e.identifier, e.name, e.description) for e in _Image_alpha_mode.enum_items),
|
||||
default=_Image_alpha_mode.default,
|
||||
description=_Image_alpha_mode.description,
|
||||
)
|
||||
|
||||
t = bpy.types.ImageUser.bl_rna.properties["use_auto_refresh"]
|
||||
_ImageUser_use_auto_refresh = bpy.types.ImageUser.bl_rna.properties["use_auto_refresh"]
|
||||
use_auto_refresh: BoolProperty(
|
||||
name=t.name,
|
||||
name=_ImageUser_use_auto_refresh.name,
|
||||
default=True,
|
||||
description=t.description,
|
||||
description=_ImageUser_use_auto_refresh.description,
|
||||
)
|
||||
|
||||
relative: BoolProperty(
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "../mathutils/mathutils.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
@@ -3819,12 +3821,12 @@ static void bpy_bmelemseq_dealloc(BPy_BMElemSeq *self)
|
||||
/* not sure where this should go */
|
||||
static Py_hash_t bpy_bm_elem_hash(PyObject *self)
|
||||
{
|
||||
return _Py_HashPointer(((BPy_BMElem *)self)->ele);
|
||||
return Py_HashPointer(((BPy_BMElem *)self)->ele);
|
||||
}
|
||||
|
||||
static Py_hash_t bpy_bm_hash(PyObject *self)
|
||||
{
|
||||
return _Py_HashPointer(((BPy_BMesh *)self)->bm);
|
||||
return Py_HashPointer(((BPy_BMesh *)self)->bm);
|
||||
}
|
||||
|
||||
/* Type Doc-strings
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#include "blf_py_api.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "py_capi_utils.hh"
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
#include "../../imbuf/IMB_imbuf.hh"
|
||||
#include "../../imbuf/IMB_imbuf_types.hh"
|
||||
|
||||
#include "python_compat.hh"
|
||||
#include "python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "python_utildefines.hh"
|
||||
|
||||
#include "imbuf_py_api.hh"
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
#include "python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "../BPY_extern.hh"
|
||||
|
||||
BPy_ThreadStatePtr BPY_thread_save()
|
||||
@@ -20,7 +22,7 @@ BPy_ThreadStatePtr BPY_thread_save()
|
||||
*
|
||||
* `PyEval_SaveThread()` will release the GIL, so this thread has to have the GIL to begin with
|
||||
* or badness will ensue. */
|
||||
if (_PyThreadState_UncheckedGet() && PyGILState_Check()) {
|
||||
if (PyThreadState_GetUnchecked() && PyGILState_Check()) {
|
||||
return (BPy_ThreadStatePtr)PyEval_SaveThread();
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
#include "python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
@@ -142,7 +144,7 @@ static PyObject *idprop_py_from_idp_idparray(ID *id, IDProperty *prop)
|
||||
/* use for both array and group */
|
||||
static Py_hash_t BPy_IDGroup_hash(BPy_IDProperty *self)
|
||||
{
|
||||
return _Py_HashPointer(self->prop);
|
||||
return Py_HashPointer(self->prop);
|
||||
}
|
||||
|
||||
static PyObject *BPy_IDGroup_repr(BPy_IDProperty *self)
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
#include "python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_string.h"
|
||||
@@ -1009,7 +1011,7 @@ static PyObject *BPy_IDPropertyUIManager_repr(BPy_IDPropertyUIManager *self)
|
||||
|
||||
static Py_hash_t BPy_IDPropertyUIManager_hash(BPy_IDPropertyUIManager *self)
|
||||
{
|
||||
return _Py_HashPointer(self->property);
|
||||
return Py_HashPointer(self->property);
|
||||
}
|
||||
|
||||
PyTypeObject BPy_IDPropertyUIManager_Type = {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include "py_capi_utils.hh"
|
||||
|
||||
#include "python_compat.hh"
|
||||
#include "python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "imbuf_py_api.hh" /* own include */
|
||||
|
||||
@@ -403,7 +403,7 @@ static PyObject *py_imbuf_repr(Py_ImBuf *self)
|
||||
|
||||
static Py_hash_t py_imbuf_hash(Py_ImBuf *self)
|
||||
{
|
||||
return _Py_HashPointer(self->ibuf);
|
||||
return Py_HashPointer(self->ibuf);
|
||||
}
|
||||
|
||||
PyTypeObject Py_ImBuf_Type = {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "GPU_state.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "gpu_py.hh"
|
||||
#include "gpu_py_element.hh"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "GPU_compute.hh"
|
||||
#include "GPU_state.hh"
|
||||
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "gpu_py.hh"
|
||||
#include "gpu_py_compute.hh" /* own include */
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "gpu_py.hh"
|
||||
#include "gpu_py_element.hh" /* own include */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "GPU_init_exit.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
#include "../generic/python_utildefines.hh"
|
||||
|
||||
#include "../mathutils/mathutils.hh"
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "../mathutils/mathutils.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "gpu_py.hh"
|
||||
#include "gpu_py_texture.hh"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "GPU_uniform_buffer.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
#include "../generic/python_utildefines.hh"
|
||||
|
||||
#include "../mathutils/mathutils.hh"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "intern/gpu_shader_create_info.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "gpu_py_shader.hh" /* own include */
|
||||
#include "gpu_py_texture.hh"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "BKE_image.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "gpu_py.hh"
|
||||
#include "gpu_py_buffer.hh"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "GPU_context.hh"
|
||||
#include "GPU_uniform_buffer.hh"
|
||||
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "gpu_py.hh"
|
||||
#include "gpu_py_uniformbuffer.hh" /* own include */
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "GPU_vertex_buffer.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "gpu_py.hh"
|
||||
#include "gpu_py_vertex_buffer.hh" /* own include */
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <Python.h>
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "gpu_py.hh"
|
||||
#include "gpu_py_vertex_format.hh" /* own include */
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#include "bpy_utils_units.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
#include "../generic/python_utildefines.hh"
|
||||
|
||||
/* external util modules */
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
#include "../generic/py_capi_rna.hh"
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#ifdef BUILD_DATE
|
||||
extern "C" char build_date[];
|
||||
@@ -696,7 +696,7 @@ PyObject *BPY_app_struct()
|
||||
BlenderAppType.tp_init = nullptr;
|
||||
BlenderAppType.tp_new = nullptr;
|
||||
/* Without this we can't do `set(sys.modules)` #29635. */
|
||||
BlenderAppType.tp_hash = (hashfunc)_Py_HashPointer;
|
||||
BlenderAppType.tp_hash = (hashfunc)Py_HashPointer;
|
||||
|
||||
/* Kind of a hack on top of #PyStructSequence. */
|
||||
py_struct_seq_getset_init();
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "BLI_utildefines.h"
|
||||
#include <Python.h>
|
||||
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "bpy_app_alembic.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
@@ -85,7 +87,7 @@ PyObject *BPY_app_alembic_struct()
|
||||
BlenderAppABCType.tp_init = nullptr;
|
||||
BlenderAppABCType.tp_new = nullptr;
|
||||
/* Without this we can't do `set(sys.modules)` #29635. */
|
||||
BlenderAppABCType.tp_hash = (hashfunc)_Py_HashPointer;
|
||||
BlenderAppABCType.tp_hash = (hashfunc)Py_HashPointer;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "bpy_app_build_options.hh"
|
||||
@@ -357,7 +359,7 @@ PyObject *BPY_app_build_options_struct()
|
||||
BlenderAppBuildOptionsType.tp_init = nullptr;
|
||||
BlenderAppBuildOptionsType.tp_new = nullptr;
|
||||
/* Without this we can't do `set(sys.modules)` #29635. */
|
||||
BlenderAppBuildOptionsType.tp_hash = (hashfunc)_Py_HashPointer;
|
||||
BlenderAppBuildOptionsType.tp_hash = (hashfunc)Py_HashPointer;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "BLI_utildefines.h"
|
||||
#include <Python.h>
|
||||
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "bpy_app_ffmpeg.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
@@ -130,7 +132,7 @@ PyObject *BPY_app_ffmpeg_struct()
|
||||
BlenderAppFFmpegType.tp_init = nullptr;
|
||||
BlenderAppFFmpegType.tp_new = nullptr;
|
||||
/* Without this we can't do `set(sys.modules)` #29635. */
|
||||
BlenderAppFFmpegType.tp_hash = (hashfunc)_Py_HashPointer;
|
||||
BlenderAppFFmpegType.tp_hash = (hashfunc)Py_HashPointer;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#include "BLI_utildefines.h"
|
||||
#include <Python.h>
|
||||
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "BKE_callbacks.hh"
|
||||
|
||||
#include "RNA_access.hh"
|
||||
@@ -270,7 +272,7 @@ PyObject *BPY_app_handlers_struct()
|
||||
BlenderAppCbType.tp_init = nullptr;
|
||||
BlenderAppCbType.tp_new = nullptr;
|
||||
/* Without this we can't do `set(sys.modules)` #29635. */
|
||||
BlenderAppCbType.tp_hash = (hashfunc)_Py_HashPointer;
|
||||
BlenderAppCbType.tp_hash = (hashfunc)Py_HashPointer;
|
||||
|
||||
/* assign the C callbacks */
|
||||
if (ret) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "BKE_icons.h"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "bpy_app_icons.hh"
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "BLI_utildefines.h"
|
||||
#include <Python.h>
|
||||
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "bpy_app_ocio.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
@@ -84,7 +86,7 @@ PyObject *BPY_app_ocio_struct()
|
||||
BlenderAppOCIOType.tp_init = nullptr;
|
||||
BlenderAppOCIOType.tp_new = nullptr;
|
||||
/* Without this we can't do `set(sys.modules)` #29635. */
|
||||
BlenderAppOCIOType.tp_hash = (hashfunc)_Py_HashPointer;
|
||||
BlenderAppOCIOType.tp_hash = (hashfunc)Py_HashPointer;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "BLI_utildefines.h"
|
||||
#include <Python.h>
|
||||
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "bpy_app_oiio.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
@@ -74,7 +76,7 @@ PyObject *BPY_app_oiio_struct()
|
||||
BlenderAppOIIOType.tp_init = nullptr;
|
||||
BlenderAppOIIOType.tp_new = nullptr;
|
||||
/* Without this we can't do `set(sys.modules)` #29635. */
|
||||
BlenderAppOIIOType.tp_hash = (hashfunc)_Py_HashPointer;
|
||||
BlenderAppOIIOType.tp_hash = (hashfunc)Py_HashPointer;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "BLI_utildefines.h"
|
||||
#include <Python.h>
|
||||
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "bpy_app_opensubdiv.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
@@ -85,7 +87,7 @@ PyObject *BPY_app_opensubdiv_struct()
|
||||
BlenderAppOpenSubdivType.tp_init = nullptr;
|
||||
BlenderAppOpenSubdivType.tp_new = nullptr;
|
||||
/* Without this we can't do `set(sys.modules)` #29635. */
|
||||
BlenderAppOpenSubdivType.tp_hash = (hashfunc)_Py_HashPointer;
|
||||
BlenderAppOpenSubdivType.tp_hash = (hashfunc)Py_HashPointer;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "BLI_utildefines.h"
|
||||
#include <Python.h>
|
||||
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "bpy_app_openvdb.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
@@ -89,7 +91,7 @@ PyObject *BPY_app_openvdb_struct()
|
||||
BlenderAppOVDBType.tp_init = nullptr;
|
||||
BlenderAppOVDBType.tp_new = nullptr;
|
||||
/* Without this we can't do `set(sys.modules)` #29635. */
|
||||
BlenderAppOVDBType.tp_hash = (hashfunc)_Py_HashPointer;
|
||||
BlenderAppOVDBType.tp_hash = (hashfunc)Py_HashPointer;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "BLI_utildefines.h"
|
||||
#include <Python.h>
|
||||
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "bpy_app_sdl.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
@@ -101,7 +103,7 @@ PyObject *BPY_app_sdl_struct()
|
||||
BlenderAppSDLType.tp_init = nullptr;
|
||||
BlenderAppSDLType.tp_new = nullptr;
|
||||
/* Without this we can't do `set(sys.modules)` #29635. */
|
||||
BlenderAppSDLType.tp_hash = (hashfunc)_Py_HashPointer;
|
||||
BlenderAppSDLType.tp_hash = (hashfunc)Py_HashPointer;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "bpy_app_timers.hh"
|
||||
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
static double handle_returned_value(PyObject *function, PyObject *ret)
|
||||
{
|
||||
|
||||
@@ -11,9 +11,12 @@
|
||||
*/
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
/* XXX Why bloody hell isn't that included in Python.h???? */
|
||||
#include <structmember.h>
|
||||
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BPY_extern.hh"
|
||||
@@ -982,7 +985,7 @@ PyObject *BPY_app_translations_struct()
|
||||
/* prevent user from creating new instances */
|
||||
BlenderAppTranslationsType.tp_new = nullptr;
|
||||
/* Without this we can't do `set(sys.modules)` #29635. */
|
||||
BlenderAppTranslationsType.tp_hash = (hashfunc)_Py_HashPointer;
|
||||
BlenderAppTranslationsType.tp_hash = (hashfunc)Py_HashPointer;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "BLI_utildefines.h"
|
||||
#include <Python.h>
|
||||
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "bpy_app_usd.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
@@ -87,7 +89,7 @@ PyObject *BPY_app_usd_struct()
|
||||
BlenderAppUSDType.tp_init = nullptr;
|
||||
BlenderAppUSDType.tp_new = nullptr;
|
||||
/* Without this we can't do `set(sys.modules)` #29635. */
|
||||
BlenderAppUSDType.tp_hash = (hashfunc)_Py_HashPointer;
|
||||
BlenderAppUSDType.tp_hash = (hashfunc)Py_HashPointer;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "BKE_blender_cli_command.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "bpy_cli_command.hh" /* Own include. */
|
||||
|
||||
|
||||
@@ -326,7 +326,9 @@ static bool is_opcode_secure(const int opcode)
|
||||
OK_OP(UNARY_NEGATIVE)
|
||||
OK_OP(UNARY_NOT)
|
||||
OK_OP(UNARY_INVERT)
|
||||
OK_OP(BINARY_SUBSCR)
|
||||
# if PY_VERSION_HEX < 0x030e0000
|
||||
OK_OP(BINARY_SUBSCR) /* Replaced with existing `BINARY_OP`. */
|
||||
# endif
|
||||
OK_OP(GET_LEN)
|
||||
# if PY_VERSION_HEX < 0x030c0000
|
||||
OK_OP(LIST_TO_TUPLE)
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "bpy_rna.hh"
|
||||
|
||||
#include "../generic/py_capi_rna.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
/* we may want to add, but not now */
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#ifdef WITH_PYTHON_MODULE
|
||||
# include "pylifecycle.h" /* For `Py_Version`. */
|
||||
#endif
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "CLG_log.h"
|
||||
|
||||
@@ -649,7 +650,7 @@ void BPY_python_backtrace(FILE *fp)
|
||||
fputs("\n# Python backtrace\n", fp);
|
||||
|
||||
/* Can happen in rare cases. */
|
||||
if (!_PyThreadState_UncheckedGet()) {
|
||||
if (!PyThreadState_GetUnchecked()) {
|
||||
return;
|
||||
}
|
||||
PyFrameObject *frame = PyEval_GetFrame();
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "bpy_library.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
#include "../generic/python_utildefines.hh"
|
||||
|
||||
/* nifty feature. swap out strings for RNA data */
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "bpy_rna.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
using namespace blender::bke::blendfile;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "../generic/py_capi_rna.hh"
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
#include "../generic/python_utildefines.hh"
|
||||
|
||||
#include "../mathutils/mathutils.hh"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include "../generic/py_capi_rna.hh"
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "BPY_extern.hh"
|
||||
#include "bpy_capi_utils.hh"
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
#include "../generic/py_capi_rna.hh"
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
using blender::Array;
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
#include "../generic/idprop_py_ui_api.hh"
|
||||
#include "../generic/py_capi_rna.hh"
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
#include "../generic/python_utildefines.hh"
|
||||
|
||||
#define USE_PEDANTIC_WRITE
|
||||
@@ -1163,7 +1163,7 @@ static PyObject *pyrna_func_repr(BPy_FunctionRNA *self)
|
||||
|
||||
static Py_hash_t pyrna_struct_hash(BPy_StructRNA *self)
|
||||
{
|
||||
return _Py_HashPointer(self->ptr->data);
|
||||
return Py_HashPointer(self->ptr->data);
|
||||
}
|
||||
|
||||
/* From Python's meth_hash v3.1.2. */
|
||||
@@ -1174,12 +1174,12 @@ static long pyrna_prop_hash(BPy_PropertyRNA *self)
|
||||
x = 0;
|
||||
}
|
||||
else {
|
||||
x = _Py_HashPointer(self->ptr->data);
|
||||
x = Py_HashPointer(self->ptr->data);
|
||||
if (x == -1) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
y = _Py_HashPointer((void *)(self->prop));
|
||||
y = Py_HashPointer((void *)(self->prop));
|
||||
if (y == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "bpy_rna_context.hh"
|
||||
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "RNA_access.hh"
|
||||
#include "RNA_prototypes.hh"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <cstddef>
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "BLI_string.h"
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "bpy_rna_gizmo.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "RNA_access.hh"
|
||||
#include "RNA_prototypes.hh"
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "../generic/py_capi_rna.hh"
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "RNA_enum_types.hh"
|
||||
#include "RNA_prototypes.hh"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "BKE_text.h"
|
||||
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "bpy_rna.hh"
|
||||
#include "bpy_rna_text.hh" /* Declare #BPY_rna_region_as_string_method_def. */
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "bpy_utils_units.hh"
|
||||
|
||||
#include "../generic/py_capi_utils.hh"
|
||||
#include "../generic/python_compat.hh"
|
||||
#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
|
||||
|
||||
#include "BKE_unit.hh"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user