From 26e0f51280af636e63001c6eee8c210a3db0d2c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Walter=20D=C3=B6rwald?= Date: Tue, 12 Jun 2007 16:51:31 +0000 Subject: Mention name of left operand, if "foo in unicode_string" fails. --- Objects/unicodeobject.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 39b7462..bb4036a 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -6001,8 +6001,9 @@ int PyUnicode_Contains(PyObject *container, /* Coerce the two arguments */ sub = PyUnicode_FromObject(element); if (!sub) { - PyErr_SetString(PyExc_TypeError, - "'in ' requires string as left operand"); + PyErr_Format(PyExc_TypeError, + "'in ' requires string as left operand, not %s", + element->ob_type->tp_name); return -1; } -- cgit v0.12