diff options
-rw-r--r-- | Objects/unicodeobject.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 3157cd8..1aa03f7 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -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); |