Merge branch 'master' into blender2.8
[blender.git] / source / blender / python / intern / bpy_rna.c
index 00ff63f7275394a2f45909c8ef0e72f53d069726..36df7c258671202fcfb18148dc6311b8e6f37bb9 100644 (file)
@@ -7659,10 +7659,12 @@ static int bpy_class_validate_recursive(PointerRNA *dummyptr, StructRNA *srna, v
                if (!(flag & PROP_REGISTER))
                        continue;
 
+               /* TODO(campbell): Use Python3.7x _PyObject_LookupAttr(), also in the macro below. */
                identifier = RNA_property_identifier(prop);
                item = PyObject_GetAttrString(py_class, identifier);
 
                if (item == NULL) {
+                       PyErr_Clear();
                        /* Sneaky workaround to use the class name as the bl_idname */
 
 #define     BPY_REPLACEMENT_STRING(rna_attr, py_attr)                         \
@@ -7678,6 +7680,9 @@ static int bpy_class_validate_recursive(PointerRNA *dummyptr, StructRNA *srna, v
                                        }                                                         \
                                        Py_DECREF(item);                                          \
                                }                                                             \
+                               else {                                                        \
+                                       PyErr_Clear();                                            \
+                               }                                                             \
                        }  /* intentionally allow else here */
 
                        if (false) {}  /* needed for macro */