Python dict error: when trying to access a Bone via a key, and the key
was not found, a wrong error message got printed. Fix provided by
reporter Gregor Riepl. Thanks!
This commit is contained in:
2008-11-02 18:05:11 +00:00
parent 2973bd8ea2
commit a775719e23

View File

@@ -244,7 +244,8 @@ static PyObject *BonesDict_GetItem(BPy_BonesDict *self, PyObject* key)
}
if(value == NULL){ /* item not found in dict. throw exception */
char* key_str = PyString_AsString( key );
if (key_str) {
if (key_str==NULL) {
return EXPP_ReturnPyObjError(PyExc_KeyError, "bone key must be a string" );
} else {
char buffer[128];