]> granicus.if.org Git - python/commitdiff
Return a bool rather than an int from proxy_has_key().
authorGuido van Rossum <guido@python.org>
Thu, 9 Oct 2003 03:47:08 +0000 (03:47 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 9 Oct 2003 03:47:08 +0000 (03:47 +0000)
Objects/descrobject.c

index 745f95dca59b7f5525d0d972a40663e635e6aded..ec4ea56f22dfc711b9b681697efefadec3b2505a 100644 (file)
@@ -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 *