diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-13 10:54:35 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-13 10:54:35 +0300 |
commit | 6ef85af300d55030eda2bfe7cf01d92fcdc92188 (patch) | |
tree | c2eff61c7364496d19ba53f6e1d7f739cd8e51bf /source/blender/python | |
parent | 39e3a759789d493073580b04fe9c6b811321c7f6 (diff) |
exceptions in registering properties were not properly handled, allowing a single error stop the main module registration loop.
worst case 1 script error could load blender without a UI.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index c00edf7bf0f..c1bd2d87d7f 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -4908,7 +4908,7 @@ static int pyrna_deferred_register_props(StructRNA *srna, PyObject *class_dict) PyObject *item, *key; PyObject *order; Py_ssize_t pos = 0; - int ret; + int ret= 0; /* in both cases PyDict_CheckExact(class_dict) will be true even * though Operators have a metaclass dict namespace */ @@ -4918,7 +4918,7 @@ static int pyrna_deferred_register_props(StructRNA *srna, PyObject *class_dict) key= PyList_GET_ITEM(order, pos); item= PyDict_GetItem(class_dict, key); ret= deferred_register_prop(srna, key, item); - if(ret==-1) + if(ret != 0) break; } } @@ -4926,12 +4926,12 @@ static int pyrna_deferred_register_props(StructRNA *srna, PyObject *class_dict) while (PyDict_Next(class_dict, &pos, &key, &item)) { ret= deferred_register_prop(srna, key, item); - if(ret==-1) + if(ret != 0) break; } } - return 0; + return ret; } static int pyrna_deferred_register_class_recursive(StructRNA *srna, PyTypeObject *py_class) |