diff options
Diffstat (limited to 'Objects/rangeobject.c')
-rw-r--r-- | Objects/rangeobject.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index 2188dfb..d7bf018 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -337,7 +337,10 @@ static PyObject * range_count(rangeobject *r, PyObject *ob) { if (PyLong_CheckExact(ob) || PyBool_Check(ob)) { - if (range_contains_long(r, ob)) + int result = range_contains_long(r, ob); + if (result == -1) + return NULL; + else if (result) return PyLong_FromLong(1); else return PyLong_FromLong(0); |