From c8d6bba3cce77ff2005205ab2af0d1757ef29b4c Mon Sep 17 00:00:00 2001 From: Martin Felke Date: Sun, 2 Dec 2018 22:16:16 +0100 Subject: backport of master fix for https://developer.blender.org/T56969 allows to let the branch run with python 3.7 too --- source/blender/python/intern/bpy_rna.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 0d3781ca176..38d139188f9 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -7388,7 +7388,13 @@ static int bpy_class_validate_recursive(PointerRNA *dummyptr, StructRNA *srna, v identifier = RNA_property_identifier(prop); item = PyObject_GetAttrString(py_class, identifier); + /* TODO(campbell): Use Python3.7x _PyObject_LookupAttr(), also in the macro below. */ + /* backported fix from 2.79 master to allow 2.79b based fracture_modifier branch + * running with Python 3.7x which would throw an error here, + * symptom was no rendered UI elements, + * https://developer.blender.org/T56969 - Martin Felke */ if (item == NULL) { + PyErr_Clear(); /* Sneaky workaround to use the class name as the bl_idname */ #define BPY_REPLACEMENT_STRING(rna_attr, py_attr) \ @@ -7404,6 +7410,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 */ -- cgit v1.2.3