]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Marc-Andre Lemburg <mal@lemburg.com>:
authorMarc-André Lemburg <mal@egenix.com>
Wed, 28 Jun 2000 08:11:47 +0000 (08:11 +0000)
committerMarc-André Lemburg <mal@egenix.com>
Wed, 28 Jun 2000 08:11:47 +0000 (08:11 +0000)
Better error message for "1 in unicodestring". Submitted
by Andrew Kuchling.

Objects/unicodeobject.c

index 3157cd89c516aa0339efba516ba62cfd97744eae..1aa03f74c0200c58ec7672c605cdc628c3d50e2b 100644 (file)
@@ -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);