]> granicus.if.org Git - python/commitdiff
Instead of "attribute-less object", issue an error message that
authorGuido van Rossum <guido@python.org>
Mon, 19 Jan 1998 22:16:36 +0000 (22:16 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 19 Jan 1998 22:16:36 +0000 (22:16 +0000)
contains the type of the object and name of the attribute.

Objects/object.c

index 46487de851ed72c3e1112ca1aa6502a2924916f4..0de095f7491a72182910b27d9c47662a7f9c3489 100644 (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 {