[Python-checkins] r73535 - python/branches/py3k/Modules/itertoolsmodule.c

raymond.hettinger python-checkins at python.org
Tue Jun 23 23:27:39 CEST 2009


Author: raymond.hettinger
Date: Tue Jun 23 23:27:39 2009
New Revision: 73535

Log:
Issue 6305: Clarify error message for large arguments to itertools.islice().

Modified:
   python/branches/py3k/Modules/itertoolsmodule.c

Modified: python/branches/py3k/Modules/itertoolsmodule.c
==============================================================================
--- python/branches/py3k/Modules/itertoolsmodule.c	(original)
+++ python/branches/py3k/Modules/itertoolsmodule.c	Tue Jun 23 23:27:39 2009
@@ -1137,7 +1137,7 @@
 				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 @@
 				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;
 	}
 


More information about the Python-checkins mailing list