diff options
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index c316caf..3e6b70b 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -14279,7 +14279,8 @@ unicode_subscript(PyObject* self, PyObject* item) assert(_PyUnicode_CheckConsistency(result, 1)); return result; } else { - PyErr_SetString(PyExc_TypeError, "string indices must be integers"); + PyErr_Format(PyExc_TypeError, "string indices must be integers, not '%.200s'", + Py_TYPE(item)->tp_name); return NULL; } } |