mirror of
https://github.com/python/cpython.git
synced 2025-07-24 19:54:21 +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 */
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue