From 7c014684c27ad646107b9f17882f43e7bd96f252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lemburg?= Date: Wed, 28 Jun 2000 08:11:47 +0000 Subject: [PATCH] Marc-Andre Lemburg : Better error message for "1 in unicodestring". Submitted by Andrew Kuchling. --- Objects/unicodeobject.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 3157cd89c51..1aa03f74c02 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);