summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorKristján Valur Jónsson <kristjan@ccpgames.com>2014-03-04 23:19:24 (GMT)
committerKristján Valur Jónsson <kristjan@ccpgames.com>2014-03-04 23:19:24 (GMT)
commit4ca688edeb07de955e1ef67c11f0e327f12ffa6e (patch)
tree27fa902c07258b5749d0984566d7df4ba73d740d /Objects
parent682ea5f70e5450ffd5a50ef7f39d65c2faeb6b63 (diff)
downloadcpython-4ca688edeb07de955e1ef67c11f0e327f12ffa6e.zip
cpython-4ca688edeb07de955e1ef67c11f0e327f12ffa6e.tar.gz
cpython-4ca688edeb07de955e1ef67c11f0e327f12ffa6e.tar.bz2
Fix pickling of rangeiter. rangeiter_setstate would not allow setting it
to the exhausted state.
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;
}