]> granicus.if.org Git - python/commitdiff
Mention name of left operand, if "foo in unicode_string"
authorWalter Dörwald <walter@livinglogic.de>
Tue, 12 Jun 2007 16:51:31 +0000 (16:51 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Tue, 12 Jun 2007 16:51:31 +0000 (16:51 +0000)
fails.

Objects/unicodeobject.c

index 39b746288b58d87c4f073e0fb33586c0e7a31985..bb4036aa7acd1ee6fbd5f6e6bc0c493b8479c559 100644 (file)
@@ -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;
     }