Commit 5d5e7c0e authored by Raymond Hettinger's avatar Raymond Hettinger

SF patch #664192 bug #661913: inconsistent error messages between string

                              and unicode

Patch by Christopher Blunck.
parent a2e303c3
...@@ -1620,7 +1620,7 @@ string_index(PyStringObject *self, PyObject *args) ...@@ -1620,7 +1620,7 @@ string_index(PyStringObject *self, PyObject *args)
return NULL; return NULL;
if (result == -1) { if (result == -1) {
PyErr_SetString(PyExc_ValueError, PyErr_SetString(PyExc_ValueError,
"substring not found in string.index"); "substring not found");
return NULL; return NULL;
} }
return PyInt_FromLong(result); return PyInt_FromLong(result);
...@@ -1659,7 +1659,7 @@ string_rindex(PyStringObject *self, PyObject *args) ...@@ -1659,7 +1659,7 @@ string_rindex(PyStringObject *self, PyObject *args)
return NULL; return NULL;
if (result == -1) { if (result == -1) {
PyErr_SetString(PyExc_ValueError, PyErr_SetString(PyExc_ValueError,
"substring not found in string.rindex"); "substring not found");
return NULL; return NULL;
} }
return PyInt_FromLong(result); return PyInt_FromLong(result);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment