https://github.com/python/cpython/commit/ac8da34621a574cd5773217404757a294025ba49
commit: ac8da34621a574cd5773217404757a294025ba49
branch: main
author: Sam Gross <[email protected]>
committer: encukou <[email protected]>
date: 2024-07-30T00:15:03+02:00
summary:

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.

files:
M Lib/test/libregrtest/refleak.py

diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py
index 20b05954c762ff..fa447a4336a399 100644
--- a/Lib/test/libregrtest/refleak.py
+++ b/Lib/test/libregrtest/refleak.py
@@ -145,7 +145,7 @@ def get_pooled_int(value):
             # 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)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to