Commit 2cf74f15 authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

Patch from Michael Hudson: improve unclear error message

parent c1d6644b
......@@ -393,7 +393,7 @@ PyObject *a, *el;
return PyUnicode_Contains(a, el);
if (!PyString_Check(el) || PyString_Size(el) != 1) {
PyErr_SetString(PyExc_TypeError,
"string member test needs char left operand");
"'in <string>' requires character as left operand");
return -1;
}
c = PyString_AsString(el)[0];
......
......@@ -2996,7 +2996,7 @@ int PyUnicode_Contains(PyObject *container,
/* Check v in u */
if (PyUnicode_GET_SIZE(v) != 1) {
PyErr_SetString(PyExc_TypeError,
"string member test needs char left operand");
"'in <string>' requires character as left operand");
goto onError;
}
ch = *PyUnicode_AS_UNICODE(v);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment