From 98c65bed91432bf17a335382cdd672b16391f10c Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 9 Oct 2003 03:47:08 +0000 Subject: Return a bool rather than an int from proxy_has_key(). --- Objects/descrobject.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 745f95d..ec4ea56 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -709,7 +709,10 @@ static PySequenceMethods proxy_as_sequence = { static PyObject * proxy_has_key(proxyobject *pp, PyObject *key) { - return PyInt_FromLong(PySequence_Contains(pp->dict, key)); + int res = PySequence_Contains(pp->dict, key); + if (res < 0) + return NULL; + return PyBool_FromLong(res); } static PyObject * -- cgit v0.12