summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/rangeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index d790ca8..4b218b8 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -1000,7 +1000,7 @@ rangeiter_setstate(rangeiterobject *r, PyObject *state)
long index = PyLong_AsLong(state);
if (index == -1 && PyErr_Occurred())
return NULL;
- if (index < 0 || index >= r->len) {
+ if (index < 0 || index > r->len) {
PyErr_SetString(PyExc_ValueError, "index out of range");
return NULL;
}