]> granicus.if.org Git - python/commitdiff
Issue 6305: Clarify error message for large arguments to itertools.islice().
authorRaymond Hettinger <python@rcn.com>
Tue, 23 Jun 2009 21:32:28 +0000 (21:32 +0000)
committerRaymond Hettinger <python@rcn.com>
Tue, 23 Jun 2009 21:32:28 +0000 (21:32 +0000)
Modules/itertoolsmodule.c

index 1353e76819a1674f0cca24e5d9173353e1551743..64e36066b4780c2444b53222f858a0326b4514a4 100644 (file)
@@ -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;
        }