diff options
Diffstat (limited to 'Objects/descrobject.c')
-rw-r--r-- | Objects/descrobject.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 745f95d..ec4ea56 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 * |