From a91e1650aafd63e7940a1c838aa1377981ad459c Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Wed, 8 Nov 2000 18:37:05 +0000 Subject: In the containment test, get the boundary condition right. ">" was used where ">=" should have been. This closes bug #121965. --- Objects/rangeobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index 5c794fc..0deabe9 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -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; } -- cgit v0.12