From cb95a1470ace2d64db306f51203852e8d6d43d1b Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Fri, 9 Jun 2000 14:04:53 +0000 Subject: [PATCH] Patch from Michael Hudson: improve unclear error message --- Objects/stringobject.c | 2 +- Objects/unicodeobject.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Objects/stringobject.c b/Objects/stringobject.c index ce6548b6f64..5d754b0fbfb 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -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 ' requires character as left operand"); return -1; } c = PyString_AsString(el)[0]; diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 5548748cac9..1ea83f6ea56 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -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 ' requires character as left operand"); goto onError; } ch = *PyUnicode_AS_UNICODE(v);