From c8fe77bd4c8c73c7a10b3c3e046e39130d43e3ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Thu, 29 Nov 2001 18:08:31 +0000 Subject: Use identity instead of equality when looking for referrers. Fixes #485781. --- Modules/gcmodule.c | 7 ++++--- 1 file 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; } -- cgit v0.12