Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-07-12 09:28:06 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-12 09:30:39 +0300
commit1db47a2ccd1e68994bf8140eba6cc2a26a2bc91f (patch)
tree8c3024a8adffd1c07c6d761afe12a5ca8de3d582 /source/blender/python
parentb843753ad56a89035faeeb94dbeb39060c0c9630 (diff)
Fix PyRNA class registration w/ Python 3.7
In Python3.7 this now raises an error.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy_rna.c5
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 9052b6f580a..80b0aa7a51b 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -7577,10 +7577,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) \
@@ -7596,6 +7598,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 */