Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-11-11 00:36:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-11-11 01:11:21 +0300
commitcd9acfed4f7674b84be965d469a367aef96f8af3 (patch)
tree2b0d8785ffe57874576157261eb007d3731b5a35 /source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp
parent86bdd2acc66c95c3698525ab3d5d6263cc1b825c (diff)
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.
Diffstat (limited to 'source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp')
-rw-r--r--source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp
index 3a6c6f0117f..28c4425b2a4 100644
--- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp
+++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp
@@ -135,9 +135,11 @@ PyTypeObject UnaryFunction0DVectorViewShape_Type = {
sizeof(BPy_UnaryFunction0DVectorViewShape), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)UnaryFunction0DVectorViewShape___dealloc__, /* tp_dealloc */
- /* Incompatible with Python3.8+ (deprecated function).
- * NOLINTNEXTLINE: modernize-use-nullptr. */
- 0, /* tp_print */
+#if PY_VERSION_HEX >= 0x03080000
+ 0, /* tp_vectorcall_offset */
+#else
+ nullptr, /* tp_print */
+#endif
nullptr, /* tp_getattr */
nullptr, /* tp_setattr */
nullptr, /* tp_reserved */