mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-127705: Use _PyStackRef
s in the default build. (GH-127875)
This commit is contained in:
parent
7cc99a54b7
commit
2bef8ea8ea
21 changed files with 688 additions and 254 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue