diff options
author | Guido van Rossum <guido@python.org> | 2001-10-22 04:12:44 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-10-22 04:12:44 +0000 |
commit | 0452fb8d4c520a80c5196fd55abf40a516836776 (patch) | |
tree | 8f81ff7a06d15072153e804ebaac647d1ca5c22d /Objects/stringobject.c | |
parent | c8fe43c7602a4b239da9a7260ec0f8a3cb9b331e (diff) | |
download | cpython-0452fb8d4c520a80c5196fd55abf40a516836776.tar.gz |
Make the error message for unsupported operand types cleaner, in
response to a message by Laura Creighton on c.l.py. E.g.
>>> 0+''
TypeError: unsupported operand types for +: 'int' and 'str'
(previously this did not mention the operand types)
>>> ''+0
TypeError: cannot concatenate 'str' and 'int' objects
Diffstat (limited to 'Objects/stringobject.c')
-rw-r--r-- | Objects/stringobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 0a3155e297..74c4b5206e 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -691,7 +691,7 @@ string_concat(register PyStringObject *a, register PyObject *bb) return PyUnicode_Concat((PyObject *)a, bb); #endif PyErr_Format(PyExc_TypeError, - "cannot add type \"%.200s\" to string", + "cannot concatenate 'str' and '%.200s' objects", bb->ob_type->tp_name); return NULL; } |