mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
Mention name of left operand, if "foo in unicode_string"
fails.
This commit is contained in:
parent
42748a8d6d
commit
26e0f51280
1 changed files with 3 additions and 2 deletions
|
|
@ -6001,8 +6001,9 @@ int PyUnicode_Contains(PyObject *container,
|
||||||
/* Coerce the two arguments */
|
/* Coerce the two arguments */
|
||||||
sub = PyUnicode_FromObject(element);
|
sub = PyUnicode_FromObject(element);
|
||||||
if (!sub) {
|
if (!sub) {
|
||||||
PyErr_SetString(PyExc_TypeError,
|
PyErr_Format(PyExc_TypeError,
|
||||||
"'in <string>' requires string as left operand");
|
"'in <string>' requires string as left operand, not %s",
|
||||||
|
element->ob_type->tp_name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue