diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index dfd3cac1c7b..5ea5d6fb87d 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -220,7 +220,7 @@ range_item(rangeobject *r, Py_ssize_t i) } /* XXX(nnorwitz): optimize for short ints. */ - rem = PyLong_FromSsize_t(i % len); + rem = PyLong_FromSsize_t(i); if (!rem) return NULL; incr = PyNumber_Multiply(rem, r->step);