gh-136517: Print uncollectable objects if DEBUG_UNCOLLECTABLE mode was set (#136518)

This commit is contained in:
Sergey Miryanov 2025-07-10 14:13:23 -07:00 committed by GitHub
parent 59acdba820
commit c560df9658
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View file

@ -1782,7 +1782,7 @@ gc_collect_region(PyThreadState *tstate,
Py_ssize_t n = 0;
for (gc = GC_NEXT(&finalizers); gc != &finalizers; gc = GC_NEXT(gc)) {
n++;
if (gcstate->debug & _PyGC_DEBUG_COLLECTABLE)
if (gcstate->debug & _PyGC_DEBUG_UNCOLLECTABLE)
debug_cycle("uncollectable", FROM_GC(gc));
}
stats->uncollectable = n;