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

@@ -322,7 +322,7 @@ int BPy_Wrap_SetMapItem(IDProperty *prop, PyObject *key, PyObject *val)
MEM_freeN(pkey);
return 0;
} else {
PyErr_SetString( PyExc_RuntimeError, "property not found in group" );
PyErr_SetString( PyExc_KeyError, "property not found in group" );
return -1;
}
}
@@ -336,7 +336,7 @@ int BPy_Wrap_SetMapItem(IDProperty *prop, PyObject *key, PyObject *val)
err = BPy_IDProperty_Map_ValidateAndCreate(_PyUnicode_AsString(key), prop, val);
if (err) {
PyErr_SetString( PyExc_RuntimeError, err );
PyErr_SetString( PyExc_KeyError, err );
return -1;
}