From: Guido van Rossum Date: Mon, 19 Jan 1998 22:16:36 +0000 (+0000) Subject: Instead of "attribute-less object", issue an error message that X-Git-Tag: v1.5.1~935 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=db9351643dd9019bdbb37dd76710c38b07774ed7;p=thirdparty%2FPython%2Fcpython.git Instead of "attribute-less object", issue an error message that contains the type of the object and name of the attribute. --- diff --git a/Objects/object.c b/Objects/object.c index 46487de851ed..0de095f7491a 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -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 {