Skip to content

Commit ac8da34

Browse files
authored
pythongh-122420: Fix accounting for immortal interned strings in refleak.py (pythonGH-122421)
The `_PyUnicode_Intern*` functions already adjust the total refcount, so we don't want to readjust it in refleak.py.
1 parent 7797182 commit ac8da34

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)