[Bf-blender-cvs] [0a8effa0f68] temp-asset-representation: Cleanup: correct type of RNA struct methods

Campbell Barton noreply at git.blender.org
Tue Nov 8 12:42:26 CET 2022


Commit: 0a8effa0f686427a3dd077eb17fa7715b3556e7e
Author: Campbell Barton
Date:   Tue Nov 8 11:26:33 2022 +1100
Branches: temp-asset-representation
https://developer.blender.org/rB0a8effa0f686427a3dd077eb17fa7715b3556e7e

Cleanup: correct type of RNA struct methods

Some BPy_StructRNA methods used BPy_PropertyRNA in their function
signatures, while this didn't case any bugs, it could lead to issues
in the future.

===================================================================

M	source/blender/python/intern/bpy_rna.c

===================================================================

diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index e6e9a3ec2bc..4b767926f7a 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -3497,7 +3497,7 @@ PyDoc_STRVAR(pyrna_struct_keys_doc,
              "   :return: custom property keys.\n"
              "   :rtype: :class:`idprop.type.IDPropertyGroupViewKeys`\n"
              "\n" BPY_DOC_ID_PROP_TYPE_NOTE);
-static PyObject *pyrna_struct_keys(BPy_PropertyRNA *self)
+static PyObject *pyrna_struct_keys(BPy_StructRNA *self)
 {
   if (RNA_struct_idprops_check(self->ptr.type) == 0) {
     PyErr_SetString(PyExc_TypeError, "bpy_struct.keys(): this type doesn't support IDProperties");
@@ -3518,7 +3518,7 @@ PyDoc_STRVAR(pyrna_struct_items_doc,
              "   :return: custom property key, value pairs.\n"
              "   :rtype: :class:`idprop.type.IDPropertyGroupViewItems`\n"
              "\n" BPY_DOC_ID_PROP_TYPE_NOTE);
-static PyObject *pyrna_struct_items(BPy_PropertyRNA *self)
+static PyObject *pyrna_struct_items(BPy_StructRNA *self)
 {
   if (RNA_struct_idprops_check(self->ptr.type) == 0) {
     PyErr_SetString(PyExc_TypeError, "bpy_struct.items(): this type doesn't support IDProperties");
@@ -3539,7 +3539,7 @@ PyDoc_STRVAR(pyrna_struct_values_doc,
              "   :return: custom property values.\n"
              "   :rtype: :class:`idprop.type.IDPropertyGroupViewValues`\n"
              "\n" BPY_DOC_ID_PROP_TYPE_NOTE);
-static PyObject *pyrna_struct_values(BPy_PropertyRNA *self)
+static PyObject *pyrna_struct_values(BPy_StructRNA *self)
 {
   if (RNA_struct_idprops_check(self->ptr.type) == 0) {
     PyErr_SetString(PyExc_TypeError,



More information about the Bf-blender-cvs mailing list