From 8bb10b2d33f669ac74c7c0b3c005b09906244830 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 14 Oct 2025 09:11:07 +1100 Subject: [PATCH] Build: resolve error with Python 3.13 Follow up to !147783, it should have included 3.13 in the version range. --- source/blender/python/generic/python_compat.cc | 4 ++-- source/blender/python/generic/python_compat.hh | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/blender/python/generic/python_compat.cc b/source/blender/python/generic/python_compat.cc index c72a4c897c4..9d7ca0da9ae 100644 --- a/source/blender/python/generic/python_compat.cc +++ b/source/blender/python/generic/python_compat.cc @@ -14,9 +14,9 @@ #include "BLI_utildefines.h" /* IWYU pragma: keep. */ #include "python_compat.hh" /* IWYU pragma: keep. */ -#if PY_VERSION_HEX >= 0x030e0000 /* >=3.14 */ +#if PY_VERSION_HEX >= 0x030d0000 /* >=3.14 */ -/* Removed in Python 3.14. */ +/* Removed in Python 3.13. */ int _PyArg_CheckPositional(const char *name, Py_ssize_t nargs, Py_ssize_t min, Py_ssize_t max) { BLI_assert(min >= 0); diff --git a/source/blender/python/generic/python_compat.hh b/source/blender/python/generic/python_compat.hh index a44faf99b73..da17683f7ab 100644 --- a/source/blender/python/generic/python_compat.hh +++ b/source/blender/python/generic/python_compat.hh @@ -49,6 +49,8 @@ # define Py_HashPointer _Py_HashPointer # define PyThreadState_GetUnchecked _PyThreadState_UncheckedGet /* TODO: Support: `PyDict_Pop`, it has different arguments. */ -#else /* >= 3.14 */ +#endif + +#if PY_VERSION_HEX >= 0x030d0000 /* >= 3.13 */ int _PyArg_CheckPositional(const char *name, Py_ssize_t nargs, Py_ssize_t min, Py_ssize_t max); #endif