Instead of "attribute-less object", issue an error message that

contains the type of the object and name of the attribute.
This commit is contained in:
Guido van Rossum 1998-01-19 22:16:36 +00:00
parent cf57d8b8c9
commit db9351643d
1 changed files with 4 additions and 1 deletions

View File

@ -348,7 +348,10 @@ PyObject_GetAttrString(v, name)
}
if (v->ob_type->tp_getattr == NULL) {
PyErr_SetString(PyExc_AttributeError, "attribute-less object");
PyErr_Format(PyExc_AttributeError,
"'%.50s' object has no attribute '%.400s'",
v->ob_type->tp_name,
name);
return NULL;
}
else {