mirror of https://github.com/python/cpython.git
Return a bool rather than an int from proxy_has_key().
This commit is contained in:
parent
22c3dda1e6
commit
98c65bed91
|
@ -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 *
|
||||||
|
|
Loading…
Reference in New Issue