mirror of https://github.com/python/cpython
In the containment test, get the boundary condition right. ">" was used
where ">=" should have been. This closes bug #121965.
This commit is contained in:
parent
f4e13a4563
commit
a91e1650aa
|
@ -193,9 +193,9 @@ range_contains(rangeobject *r, PyObject *obj)
|
|||
if (num < 0 && PyErr_Occurred())
|
||||
return -1;
|
||||
|
||||
if (num < r->start || (num - r->start) % r->step)
|
||||
if ((num < r->start) || ((num - r->start) % r->step))
|
||||
return 0;
|
||||
if (num > (r->start + (r->len * r->step)))
|
||||
if (num >= (r->start + (r->len * r->step)))
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue