Mention name of left operand, if "foo in unicode_string"

fails.
This commit is contained in:
Walter Dörwald 2007-06-12 16:51:31 +00:00
parent 42748a8d6d
commit 26e0f51280

View 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;
}