diff options
author | Guido van Rossum <guido@python.org> | 2003-10-09 03:47:08 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2003-10-09 03:47:08 (GMT) |
commit | 98c65bed91432bf17a335382cdd672b16391f10c (patch) | |
tree | 16a051e107763d29223121baa186ca4792084eb1 /Objects/descrobject.c | |
parent | 22c3dda1e64f413d4f6781d983067d580567071b (diff) | |
download | cpython-98c65bed91432bf17a335382cdd672b16391f10c.zip cpython-98c65bed91432bf17a335382cdd672b16391f10c.tar.gz cpython-98c65bed91432bf17a335382cdd672b16391f10c.tar.bz2 |
Return a bool rather than an int from proxy_has_key().
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 * |