commit | c8fe77bd4c8c73c7a10b3c3e046e39130d43e3ba | [log] [tgz] |
---|---|---|
author | Martin v. Löwis <martin@v.loewis.de> | Thu Nov 29 18:08:31 2001 +0000 |
committer | Martin v. Löwis <martin@v.loewis.de> | Thu Nov 29 18:08:31 2001 +0000 |
tree | d34b2eeecf59cc025c469b22440e14dd02ccb56d | |
parent | 1cec7fab1dfd0956343c900d19cf1a7683abce75 [diff] |
Use identity instead of equality when looking for referrers. Fixes #485781.
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 @@ 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; }