mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Use identity instead of equality when looking for referrers. Fixes #485781.
This commit is contained in:
parent
1cec7fab1d
commit
c8fe77bd4c
1 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue