summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-06-23 21:27:39 (GMT)
committerRaymond Hettinger <python@rcn.com>2009-06-23 21:27:39 (GMT)
commitec7bfb314c9f43fbb5bc51ad0f4e20dff528db8f (patch)
tree86277887da45238088f0dddcc1ae0d95f3b055af /Modules
parentdf45cda0dd08f457ac27d37d60e936cc129ce49c (diff)
downloadcpython-ec7bfb314c9f43fbb5bc51ad0f4e20dff528db8f.zip
cpython-ec7bfb314c9f43fbb5bc51ad0f4e20dff528db8f.tar.gz
cpython-ec7bfb314c9f43fbb5bc51ad0f4e20dff528db8f.tar.bz2
Issue 6305: Clarify error message for large arguments to itertools.islice().
Diffstat (limited to 'Modules')
-rw-r--r--Modules/itertoolsmodule.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index f1e76e2..732bcd9 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -1137,7 +1137,7 @@ islice_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (PyErr_Occurred())
PyErr_Clear();
PyErr_SetString(PyExc_ValueError,
- "Stop argument for islice() must be a non-negative integer or None.");
+ "Stop argument for islice() must be None or an integer: 0 <= x <= maxsize.");
return NULL;
}
}
@@ -1152,14 +1152,14 @@ islice_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (PyErr_Occurred())
PyErr_Clear();
PyErr_SetString(PyExc_ValueError,
- "Stop argument for islice() must be a non-negative integer or None.");
+ "Stop argument for islice() must be None or an integer: 0 <= x <= maxsize.");
return NULL;
}
}
}
if (start<0 || stop<-1) {
PyErr_SetString(PyExc_ValueError,
- "Indices for islice() must be non-negative integers or None.");
+ "Indices for islice() must be None or an integer: 0 <= x <= maxsize.");
return NULL;
}