From: Marc-André Lemburg Date: Wed, 28 Jun 2000 08:11:47 +0000 (+0000) Subject: Marc-Andre Lemburg : X-Git-Tag: v2.0b1~1382 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7c014684c27ad646107b9f17882f43e7bd96f252;p=thirdparty%2FPython%2Fcpython.git Marc-Andre Lemburg : Better error message for "1 in unicodestring". Submitted by Andrew Kuchling. --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 3157cd89c516..1aa03f74c020 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 ' requires character as left operand"); goto onError; + } u = (PyUnicodeObject *)PyUnicode_FromObject(container); if (u == NULL) { Py_DECREF(v);