summaryrefslogtreecommitdiffstats
path: root/Objects/stringobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-10-22 04:12:44 (GMT)
committerGuido van Rossum <guido@python.org>2001-10-22 04:12:44 (GMT)
commit5c66a26dee41853a9ce43b75965cc16b8e34aef0 (patch)
treed303f21f83853154614174dc1b6ed1891aa68315 /Objects/stringobject.c
parent279e74457351f4b6686d2b592f6662393bc8d757 (diff)
downloadcpython-5c66a26dee41853a9ce43b75965cc16b8e34aef0.zip
cpython-5c66a26dee41853a9ce43b75965cc16b8e34aef0.tar.gz
cpython-5c66a26dee41853a9ce43b75965cc16b8e34aef0.tar.bz2
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 0a3155e..74c4b52 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;
}