diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-04-11 19:05:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-04-11 19:05:42 +0400 |
commit | a406c15d93cf8b69f75a34dce5f24a4ea03045c6 (patch) | |
tree | 05ab08de2bb0357c22c65ddd884a68bb86bd1ea6 /source/blender/python | |
parent | f28a6a90f1d59ecd8a95f3a6b636ddce6a848974 (diff) |
Python Api
own error with refcounting and raise an error when bpy.types cant generate a subtype (though it shouldn't happen)
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_panel_wrap.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/python/intern/bpy_panel_wrap.c b/source/blender/python/intern/bpy_panel_wrap.c index 4a33c90f819..bc85e5bdced 100644 --- a/source/blender/python/intern/bpy_panel_wrap.c +++ b/source/blender/python/intern/bpy_panel_wrap.c @@ -79,7 +79,7 @@ static int PyPanel_generic(int mode, const bContext *C, Panel *pnl) ret = PyObject_Call(item, args, NULL); - Py_DECREF(args); + /* args is decref'd from item */ Py_DECREF(item); } diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 3f70d914801..c7c4a5ef489 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1680,7 +1680,11 @@ static PyObject *pyrna_basetype_getattro( BPy_BaseTypeRNA * self, PyObject *pyna else PyErr_Clear(); if (RNA_property_collection_lookup_string(&self->ptr, self->prop, _PyUnicode_AsString(pyname), &newptr)) { - return pyrna_struct_Subtype(&newptr); + ret= pyrna_struct_Subtype(&newptr); + if (ret==NULL) { + PyErr_Format(PyExc_SystemError, "bpy.types.%s subtype could not be generated, this is a bug!", _PyUnicode_AsString(pyname)); + } + return ret; } else { /* Override the error */ PyErr_Format(PyExc_AttributeError, "bpy.types.%s not a valid RNA_Struct", _PyUnicode_AsString(pyname)); |