fix for memory leak, use Key Errors for pyrna getitem access & idprops

This commit is contained in:
2009-11-18 13:02:09 +00:00
parent 49c47fbf30
commit d3794d9f94
3 changed files with 5 additions and 10 deletions

View File

@@ -1218,14 +1218,14 @@ static PyObject *pyrna_struct_subscript( BPy_StructRNA *self, PyObject *key )
group= RNA_struct_idproperties(&self->ptr, 0);
if(group==NULL) {
PyErr_Format( PyExc_TypeError, "key \"%s\" not found", name);
PyErr_Format( PyExc_KeyError, "key \"%s\" not found", name);
return NULL;
}
idprop= IDP_GetPropertyFromGroup(group, name);
if(idprop==NULL) {
PyErr_Format( PyExc_TypeError, "key \"%s\" not found", name);
PyErr_Format( PyExc_KeyError, "key \"%s\" not found", name);
return NULL;
}