Mercurial > cpython-lru_cache-weakref
diff Objects/stringobject.c @ 12816:4272b368bf69 legacy-trunk
Michael Hudson <mwh21@cam.ac.uk>:
Removed PyErr_BadArgument() calls and replaced them with more useful
error messages.
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Thu, 01 Jun 2000 03:12:13 +0000 |
| parents | 67233df13037 |
| children | 98eb3059ae76 |
line wrap: on
line diff
--- a/Objects/stringobject.c Thu Jun 01 03:02:48 2000 +0000 +++ b/Objects/stringobject.c Thu Jun 01 03:12:13 2000 +0000 @@ -293,7 +293,9 @@ if (!PyString_Check(bb)) { if (PyUnicode_Check(bb)) return PyUnicode_Concat((PyObject *)a, bb); - PyErr_BadArgument(); + PyErr_Format(PyExc_TypeError, + "cannot add type \"%.200s\" to string", + bb->ob_type->tp_name); return NULL; } #define b ((PyStringObject *)bb)
