diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-07-30 07:36:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-30 07:36:08 (GMT) |
commit | a2c36ddd162f8f3fdcf55d97722b5d1fc6c9de18 (patch) | |
tree | 89911355767762a28026b5980196dc13d45ad5cd | |
parent | ae1bdcafb85e70659239935c289d41c44da9758e (diff) | |
download | cpython-a2c36ddd162f8f3fdcf55d97722b5d1fc6c9de18.zip cpython-a2c36ddd162f8f3fdcf55d97722b5d1fc6c9de18.tar.gz cpython-a2c36ddd162f8f3fdcf55d97722b5d1fc6c9de18.tar.bz2 |
[3.13] gh-122420: Fix accounting for immortal interned strings in refleak.py (GH-122421) (GH-122430)
The `_PyUnicode_Intern*` functions already adjust the total refcount, so
we don't want to readjust it in refleak.py.
(cherry picked from commit ac8da34621a574cd5773217404757a294025ba49)
Co-authored-by: Sam Gross <colesbury@gmail.com>
-rw-r--r-- | Lib/test/libregrtest/refleak.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py index d2fab19..ff811ee 100644 --- a/Lib/test/libregrtest/refleak.py +++ b/Lib/test/libregrtest/refleak.py @@ -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) |