mirror of
https://github.com/python/cpython.git
synced 2024-11-23 18:04:37 +08:00
Marc-Andre Lemburg <mal@lemburg.com>:
Better error message for "1 in unicodestring". Submitted by Andrew Kuchling.
This commit is contained in:
parent
e39607f27e
commit
7c014684c2
@ -2988,8 +2988,11 @@ int PyUnicode_Contains(PyObject *container,
|
||||
|
||||
/* Coerce the two arguments */
|
||||
v = (PyUnicodeObject *)PyUnicode_FromObject(element);
|
||||
if (v == NULL)
|
||||
if (v == NULL) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"'in <string>' requires character as left operand");
|
||||
goto onError;
|
||||
}
|
||||
u = (PyUnicodeObject *)PyUnicode_FromObject(container);
|
||||
if (u == NULL) {
|
||||
Py_DECREF(v);
|
||||
|
Loading…
Reference in New Issue
Block a user