mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
Fix pickling of rangeiter. rangeiter_setstate would not allow setting it
to the exhausted state.
This commit is contained in:
parent
682ea5f70e
commit
4ca688edeb
2 changed files with 13 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue