gh-128058: Fix test_builtin ImmortalTests (#128068)

On 32-bit Free Threading systems, immortal reference count
is 5 << 28, instead of 7 << 28.

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This commit is contained in:
Victor Stinner 2024-12-20 08:50:18 +01:00 committed by GitHub
parent 39e69a7cd5
commit daa260ebb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -2691,6 +2691,9 @@ def __del__(self):
class ImmortalTests(unittest.TestCase): class ImmortalTests(unittest.TestCase):
if sys.maxsize < (1 << 32): if sys.maxsize < (1 << 32):
if support.Py_GIL_DISABLED:
IMMORTAL_REFCOUNT = 5 << 28
else:
IMMORTAL_REFCOUNT = 7 << 28 IMMORTAL_REFCOUNT = 7 << 28
else: else:
IMMORTAL_REFCOUNT = 3 << 30 IMMORTAL_REFCOUNT = 3 << 30