1. Armin Rigo
  2. cpython-withatomic

Commits

Raymond Hettinger  committed d162946

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

  • Participants
  • Parent commits a6a1a61
  • Branches default

Comments (0)

Files changed (1)

File Modules/itertoolsmodule.c

View file
 				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 (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;
 	}