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
efd71aad4f.
Instead of suppressing clang-tidy, use preprocessor a check since
this properly represents the difference between Python versions.
This commit is contained in:
@@ -341,9 +341,11 @@ PyTypeObject Interface1D_Type = {
|
||||
sizeof(BPy_Interface1D), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
(destructor)Interface1D_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 */
|
||||
|
||||
Reference in New Issue
Block a user