summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-06-23 21:32:28 (GMT)
committerRaymond Hettinger <python@rcn.com>2009-06-23 21:32:28 (GMT)
commit0115e098daa3851f1e2eb44f277d4cd9101e61b5 (patch)
tree55fff100460364e73d181dd700e3c4fa10f7ddf6 /Modules
parent14fc673d4f6a6c9c1a622397fa864c943f0f45c9 (diff)
downloadcpython-0115e098daa3851f1e2eb44f277d4cd9101e61b5.zip
cpython-0115e098daa3851f1e2eb44f277d4cd9101e61b5.tar.gz
cpython-0115e098daa3851f1e2eb44f277d4cd9101e61b5.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 1353e76..64e3606 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 <= maxint.");
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 <= maxint.");
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 <= maxint.");
return NULL;
}