summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-01-17 23:43:43 (GMT)
committerGuido van Rossum <guido@python.org>2001-01-17 23:43:43 (GMT)
commit24f67d568cf878f53c647356aa4e446f7ae9de61 (patch)
tree16527758ece540519e889e98b55578a06335888b /Objects
parent97c9640cc9ad2fc591fd1d9a7f75f74b15599a0e (diff)
downloadcpython-24f67d568cf878f53c647356aa4e446f7ae9de61.zip
cpython-24f67d568cf878f53c647356aa4e446f7ae9de61.tar.gz
cpython-24f67d568cf878f53c647356aa4e446f7ae9de61.tar.bz2
Fix a leak in instance_coerce(). This was introduced by Neil's
earlier coercion changes, not by rich comparisons. When a coercion function returns 1 (meaning it cannot do it), it should not INCREF the arguments. When no __coerce__() method was found, instance_coerce() originally returned 0, pretending it did it. Neil changed the return value to 1, more accurately reflecting that it didn't do anything, but forgot to take out the two INCREF calls.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/classobject.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 7f76d6e..5e987ff 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -1289,8 +1289,6 @@ instance_coerce(PyObject **pv, PyObject **pw)
if (coercefunc == NULL) {
/* No __coerce__ method */
PyErr_Clear();
- Py_INCREF(v);
- Py_INCREF(w);
return 1;
}
/* Has __coerce__ method: call it */