In the containment test, get the boundary condition right. ">" was used

where ">=" should have been.

This closes bug #121965.
This commit is contained in:
Fred Drake 2000-11-08 18:37:05 +00:00
parent f4e13a4563
commit a91e1650aa
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}