From cd9acfed4f7674b84be965d469a367aef96f8af3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 11 Nov 2020 08:36:54 +1100 Subject: Cleanup: use preprocessor version check for PyTypeObject declaration While `tp_print` was deprecated, Python 3.8+ uses this for 'tp_vectorcall_offset' which wasn't stated in the comment from efd71aad4f22ec0073d80b8dd296015d3f395aa8. Instead of suppressing clang-tidy, use preprocessor a check since this properly represents the difference between Python versions. --- source/blender/python/mathutils/mathutils_Vector.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/blender/python/mathutils') diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c index 80efbf6fbac..d3bcd2376ee 100644 --- a/source/blender/python/mathutils/mathutils_Vector.c +++ b/source/blender/python/mathutils/mathutils_Vector.c @@ -3042,7 +3042,11 @@ PyTypeObject vector_Type = { /* Methods to implement standard operations */ (destructor)BaseMathObject_dealloc, /* destructor tp_dealloc; */ - (printfunc)NULL, /* printfunc tp_print; */ + #if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall_offset */ +#else + (printfunc)NULL, /* printfunc tp_print */ +#endif NULL, /* getattrfunc tp_getattr; */ NULL, /* setattrfunc tp_setattr; */ NULL, /* cmpfunc tp_compare; */ -- cgit v1.2.3