GH-127705: Use _PyStackRefs in the default build. (GH-127875)

This commit is contained in:
Mark Shannon 2025-03-10 14:06:56 +00:00 committed by GitHub
parent 7cc99a54b7
commit 2bef8ea8ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 688 additions and 254 deletions

View file

@ -2715,18 +2715,15 @@ class ShutdownTest(unittest.TestCase):
class ImmortalTests(unittest.TestCase):
if sys.maxsize < (1 << 32):
if support.Py_GIL_DISABLED:
IMMORTAL_REFCOUNT = 5 << 28
else:
IMMORTAL_REFCOUNT = 7 << 28
IMMORTAL_REFCOUNT_MINIMUM = 1 << 30
else:
IMMORTAL_REFCOUNT = 3 << 30
IMMORTAL_REFCOUNT_MINIMUM = 1 << 31
IMMORTALS = (None, True, False, Ellipsis, NotImplemented, *range(-5, 257))
def assert_immortal(self, immortal):
with self.subTest(immortal):
self.assertEqual(sys.getrefcount(immortal), self.IMMORTAL_REFCOUNT)
self.assertGreater(sys.getrefcount(immortal), self.IMMORTAL_REFCOUNT_MINIMUM)
def test_immortals(self):
for immortal in self.IMMORTALS: