From ebc0dc165dde6afeb4cefe6566cc2735bc8fc50a Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sat, 22 Mar 2025 16:22:44 -0500 Subject: [PATCH] Base: Initialize tp_versions_used in PyTypeObject (3.13) This field is undocumented, but exists in the source code for 3.13 (see https://github.com/python/cpython/blob/3.13/Include/cpython/object.h#L232) and gives a compiler warning if left uninitialized. --- src/Base/PyObjectBase.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Base/PyObjectBase.cpp b/src/Base/PyObjectBase.cpp index 8e7652836c..5ecfcb64a2 100644 --- a/src/Base/PyObjectBase.cpp +++ b/src/Base/PyObjectBase.cpp @@ -169,7 +169,9 @@ static PyTypeObject PyBaseProxyType = { #if PY_VERSION_HEX >= 0x030c0000 ,0 /*tp_watched */ #endif - +#if PY_VERSION_HEX >= 0x030d0000 + ,0 /*tp_versions_used*/ +#endif }; PyTypeObject PyObjectBase::Type = { @@ -228,6 +230,9 @@ PyTypeObject PyObjectBase::Type = { #if PY_VERSION_HEX >= 0x030c0000 ,0 /*tp_watched */ #endif +#if PY_VERSION_HEX >= 0x030d0000 + ,0 /*tp_versions_used*/ +#endif }; #if defined(__clang__)