From: Guido van Rossum Date: Thu, 9 Oct 2003 03:47:08 +0000 (+0000) Subject: Return a bool rather than an int from proxy_has_key(). X-Git-Tag: v2.4a1~1454 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=98c65bed91432bf17a335382cdd672b16391f10c;p=python Return a bool rather than an int from proxy_has_key(). --- diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 745f95dca5..ec4ea56f22 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 *