Return a bool rather than an int from proxy_has_key().

This commit is contained in:
Guido van Rossum 2003-10-09 03:47:08 +00:00
parent 22c3dda1e6
commit 98c65bed91
1 changed files with 4 additions and 1 deletions

View File

@ -709,7 +709,10 @@ static PySequenceMethods proxy_as_sequence = {
static PyObject * static PyObject *
proxy_has_key(proxyobject *pp, PyObject *key) 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 * static PyObject *