]> granicus.if.org Git - python/commitdiff
Patch from Michael Hudson: improve unclear error message
authorAndrew M. Kuchling <amk@amk.ca>
Fri, 9 Jun 2000 14:04:53 +0000 (14:04 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Fri, 9 Jun 2000 14:04:53 +0000 (14:04 +0000)
Objects/stringobject.c
Objects/unicodeobject.c

index ce6548b6f64d044081d4c6005c333476fd6f7dcd..5d754b0fbfba573a561789fe4ead74e47089779b 100644 (file)
@@ -393,7 +393,7 @@ PyObject *a, *el;
                return PyUnicode_Contains(a, el);
        if (!PyString_Check(el) || PyString_Size(el) != 1) {
                PyErr_SetString(PyExc_TypeError,
-                               "string member test needs char left operand");
+                   "'in <string>' requires character as left operand");
                return -1;
        }
        c = PyString_AsString(el)[0];
index 5548748cac9c773c5114cffbcda253984cae3abd..1ea83f6ea56de9e444b972d4e33eb0383baacca9 100644 (file)
@@ -2996,7 +2996,7 @@ int PyUnicode_Contains(PyObject *container,
     /* Check v in u */
     if (PyUnicode_GET_SIZE(v) != 1) {
        PyErr_SetString(PyExc_TypeError,
-                       "string member test needs char left operand");
+           "'in <string>' requires character as left operand");
        goto onError;
     }
     ch = *PyUnicode_AS_UNICODE(v);