summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-06-12 16:51:31 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-06-12 16:51:31 (GMT)
commit26e0f51280af636e63001c6eee8c210a3db0d2c5 (patch)
treea2e7bf8439d4a0dd76d6ffac0cd69262e687647e
parent42748a8d6dc121d5311668a0fe005c277b7d0220 (diff)
downloadcpython-26e0f51280af636e63001c6eee8c210a3db0d2c5.zip
cpython-26e0f51280af636e63001c6eee8c210a3db0d2c5.tar.gz
cpython-26e0f51280af636e63001c6eee8c210a3db0d2c5.tar.bz2
Mention name of left operand, if "foo in unicode_string"
fails.
-rw-r--r--Objects/unicodeobject.c5
1 files 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 <string>' requires string as left operand");
+ PyErr_Format(PyExc_TypeError,
+ "'in <string>' requires string as left operand, not %s",
+ element->ob_type->tp_name);
return -1;
}