diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2001-11-29 18:08:31 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2001-11-29 18:08:31 (GMT) |
commit | c8fe77bd4c8c73c7a10b3c3e046e39130d43e3ba (patch) | |
tree | d34b2eeecf59cc025c469b22440e14dd02ccb56d | |
parent | 1cec7fab1dfd0956343c900d19cf1a7683abce75 (diff) | |
download | cpython-c8fe77bd4c8c73c7a10b3c3e046e39130d43e3ba.zip cpython-c8fe77bd4c8c73c7a10b3c3e046e39130d43e3ba.tar.gz cpython-c8fe77bd4c8c73c7a10b3c3e046e39130d43e3ba.tar.bz2 |
Use identity instead of equality when looking for referrers. Fixes #485781.
-rw-r--r-- | Modules/gcmodule.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 0b49a04..f19782b 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -650,9 +650,10 @@ gc_get_thresh(PyObject *self, PyObject *args) static int referrersvisit(PyObject* obj, PyObject *objs) { - if (PySequence_Contains(objs, obj)) { - return 1; - } + int i; + for (i = 0; i < PyTuple_GET_SIZE(objs); i++) + if (PyTuple_GET_ITEM(objs, i) == obj) + return 1; return 0; } |