gh-122420: Fix accounting for immortal interned strings in refleak.py (GH-122421)

The `_PyUnicode_Intern*` functions already adjust the total refcount, so
we don't want to readjust it in refleak.py.
This commit is contained in:
Sam Gross 2024-07-29 18:15:03 -04:00 committed by GitHub
parent 7797182b78
commit ac8da34621
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -145,7 +145,7 @@ def runtest_refleak(test_name, test_func,
# Use an internal-only keyword argument that mypy doesn't know yet
_only_immortal=True) # type: ignore[call-arg]
alloc_after = getallocatedblocks() - interned_immortal_after
rc_after = gettotalrefcount() - interned_immortal_after * 2
rc_after = gettotalrefcount()
fd_after = fd_count()
rc_deltas[i] = get_pooled_int(rc_after - rc_before)