Mercurial > cpython-lru_cache-weakref
diff Objects/unicodeobject.c @ 13529:babae910c2e1 legacy-trunk
Jeremy Hylton:
better error message for unicode coercion failure
| author | Marc-André Lemburg <mal@egenix.com> |
|---|---|
| date | Tue, 11 Jul 2000 09:47:04 +0000 |
| parents | acc4638f37d5 |
| children | 61e4c29d53d8 |
line wrap: on
line diff
--- a/Objects/unicodeobject.c Tue Jul 11 04:58:12 2000 +0000 +++ b/Objects/unicodeobject.c Tue Jul 11 09:47:04 2000 +0000 @@ -406,8 +406,10 @@ /* Overwrite the error message with something more useful in case of a TypeError. */ if (PyErr_ExceptionMatches(PyExc_TypeError)) - PyErr_SetString(PyExc_TypeError, - "coercing to Unicode: need string or buffer"); + PyErr_Format(PyExc_TypeError, + "coercing to Unicode: need string or buffer, " + "%.80s found", + obj->ob_type->tp_name); goto onError; }
