diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-12 09:31:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-12 09:31:19 +0300 |
commit | 55354d734e98e8c733401f094b3d90d0b8ae3474 (patch) | |
tree | eca7da78baf485962814a60ec88061ac94c374eb /source/blender | |
parent | d28d202fd113810ad05b572b785b106fcfb00992 (diff) | |
parent | 1db47a2ccd1e68994bf8140eba6cc2a26a2bc91f (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 00ff63f7275..36df7c25867 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -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 */ |