Skip to content

Commit a2c36dd

Browse files
[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 ac8da34) Co-authored-by: Sam Gross <[email protected]>
1 parent ae1bdca commit a2c36dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/libregrtest/refleak.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def get_pooled_int(value):
145145
# Use an internal-only keyword argument that mypy doesn't know yet
146146
_only_immortal=True) # type: ignore[call-arg]
147147
alloc_after = getallocatedblocks() - interned_immortal_after
148-
rc_after = gettotalrefcount() - interned_immortal_after * 2
148+
rc_after = gettotalrefcount()
149149
fd_after = fd_count()
150150

151151
rc_deltas[i] = get_pooled_int(rc_after - rc_before)

0 commit comments

Comments
 (0)