diff options
author | Marc-André Lemburg <mal@egenix.com> | 2000-06-28 08:11:47 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2000-06-28 08:11:47 (GMT) |
commit | 7c014684c27ad646107b9f17882f43e7bd96f252 (patch) | |
tree | 8dd55cbc0fec4a872bea64b28a26fd7b5f5166e7 /Objects | |
parent | e39607f27e3c9e3c1d0077b3f5870ba2824b2763 (diff) | |
download | cpython-7c014684c27ad646107b9f17882f43e7bd96f252.zip cpython-7c014684c27ad646107b9f17882f43e7bd96f252.tar.gz cpython-7c014684c27ad646107b9f17882f43e7bd96f252.tar.bz2 |
Marc-Andre Lemburg <mal@lemburg.com>:
Better error message for "1 in unicodestring". Submitted
by Andrew Kuchling.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/unicodeobject.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 3157cd8..1aa03f7 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 <string>' requires character as left operand"); goto onError; + } u = (PyUnicodeObject *)PyUnicode_FromObject(container); if (u == NULL) { Py_DECREF(v); |