@@ -360,10 +360,10 @@ index 3311064e7c5..74c829d717e 100644
360360 if (UNLIKELY(test == -1 && PyErr_Occurred())) {
361361 return -1;
362362 }
363- diff --git a/source/blender/python/generic/py_capi_utils.h b/source/blender/python/generic/py_capi_utils.h
363+ diff --git a/source/blender/python/generic/py_capi_utils.hh b/source/blender/python/generic/py_capi_utils.hh
364364index 4a641f78471..81740e0d0ad 100644
365- --- a/source/blender/python/generic/py_capi_utils.h
366- +++ b/source/blender/python/generic/py_capi_utils.h
365+ --- a/source/blender/python/generic/py_capi_utils.hh
366+ +++ b/source/blender/python/generic/py_capi_utils.hh
367367@@ -339,7 +339,11 @@ uint64_t PyC_Long_AsU64(PyObject *value);
368368 /* inline so type signatures match as expected */
369369 Py_LOCAL_INLINE(int32_t) PyC_Long_AsI32(PyObject *value)
@@ -376,15 +376,15 @@ index 4a641f78471..81740e0d0ad 100644
376376 }
377377 Py_LOCAL_INLINE(int64_t) PyC_Long_AsI64(PyObject *value)
378378 {
379- diff --git a/source/blender/python/generic/python_compat.h b/source/blender/python/generic/python_compat.h
379+ diff --git a/source/blender/python/generic/python_compat.hh b/source/blender/python/generic/python_compat.hh
380380index f18d0fb59b3..e2799aeeb46 100644
381- --- a/source/blender/python/generic/python_compat.h
382- +++ b/source/blender/python/generic/python_compat.h
383- @@ -13,8 +13,11 @@
384- extern "C" {
385- #endif
381+ --- a/source/blender/python/generic/python_compat.hh
382+ +++ b/source/blender/python/generic/python_compat.hh
383+ @@ -9,9 +9,17 @@
384+
385+ #pragma once
386386
387- + /* Removes `initialized ` member from Python 3.13+. */
387+ + /* Removes `intialized ` member from Python 3.13+. */
388388+ #if PY_VERSION_HEX >= 0x030d0000
389389+ # define PY_ARG_PARSER_HEAD_COMPAT()
390390+ #elif PY_VERSION_HEX >= 0x030c0000
@@ -393,6 +393,12 @@ index f18d0fb59b3..e2799aeeb46 100644
393393 # define PY_ARG_PARSER_HEAD_COMPAT() 0,
394394 #else
395395 # define PY_ARG_PARSER_HEAD_COMPAT()
396+ #endif
397+ +
398+ + /* Python 3.13 made some changes, use the "new" names. */
399+ + #if PY_VERSION_HEX < 0x030d0000
400+ + # define PyObject_GetOptionalAttr _PyObject_LookupAttr
401+ + #endif
396402diff --git a/source/blender/python/gpu/gpu_py_framebuffer.cc b/source/blender/python/gpu/gpu_py_framebuffer.cc
397403index 899ad21f770..9bef53654df 100644
398404--- a/source/blender/python/gpu/gpu_py_framebuffer.cc
0 commit comments