Python Api

own error with refcounting and raise an error when bpy.types cant generate a subtype (though it shouldn't happen)
This commit is contained in:
2009-04-11 15:05:42 +00:00
parent f28a6a90f1
commit a406c15d93
2 changed files with 6 additions and 2 deletions

View File

@@ -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);
}

View File

@@ -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));