summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-01-19 22:16:36 (GMT)
committerGuido van Rossum <guido@python.org>1998-01-19 22:16:36 (GMT)
commitdb9351643dd9019bdbb37dd76710c38b07774ed7 (patch)
tree37756305e04ce84517fb27a8587b741229e592ec
parentcf57d8b8c92143342b4d978c6134d307114fbf44 (diff)
downloadcpython-db9351643dd9019bdbb37dd76710c38b07774ed7.zip
cpython-db9351643dd9019bdbb37dd76710c38b07774ed7.tar.gz
cpython-db9351643dd9019bdbb37dd76710c38b07774ed7.tar.bz2
Instead of "attribute-less object", issue an error message that
contains the type of the object and name of the attribute.
-rw-r--r--Objects/object.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 46487de..0de095f 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 {