Apply perky's fix for #1503157: "/".join([u"", u""]) raising OverflowError.

Also improve error message on overflow.
This commit is contained in:
Georg Brandl 2006-06-10 06:40:50 +00:00
parent 6946ea0be0
commit 90e27d38f5
3 changed files with 6 additions and 4 deletions

View file

@ -1788,7 +1788,7 @@ string_join(PyStringObject *self, PyObject *orig)
sz += seplen;
if (sz < old_sz || sz > PY_SSIZE_T_MAX) {
PyErr_SetString(PyExc_OverflowError,
"join() is too long for a Python string");
"join() result is too long for a Python string");
Py_DECREF(seq);
return NULL;
}