'swig_varlink_getattr' throws a wrong exception

If the attribute of a python object could not found a AttributeException
should be thrown instead of a NameException.
This commit is contained in:
Jens Krüger 2014-01-30 08:59:42 +01:00 committed by William S Fulton
commit da44064d6c

View file

@ -116,7 +116,7 @@ swig_varlink_getattr(swig_varlinkobject *v, char *n) {
var = var->next;
}
if (res == NULL && !PyErr_Occurred()) {
PyErr_SetString(PyExc_NameError,"Unknown C global variable");
PyErr_SetString(PyExc_AttributeError,"Unknown C global variable");
}
return res;
}