mirror of
https://github.com/python/cpython.git
synced 2025-07-21 18:25:22 +00:00
Return a bool rather than an int from proxy_has_key().
This commit is contained in:
parent
22c3dda1e6
commit
98c65bed91
1 changed files with 4 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue