Use correct PyGC_Head size in tests for issue #25421.

This commit is contained in:
Serhiy Storchaka 2015-12-19 22:49:29 +02:00
parent 5c4064e8bd
commit 9c297e43bf
1 changed files with 1 additions and 1 deletions

View File

@ -1115,7 +1115,7 @@ class SizeofTest(unittest.TestCase):
def check_slots(self, obj, base, extra): def check_slots(self, obj, base, extra):
expected = sys.getsizeof(base) + struct.calcsize(extra) expected = sys.getsizeof(base) + struct.calcsize(extra)
if gc.is_tracked(obj) and not gc.is_tracked(base): if gc.is_tracked(obj) and not gc.is_tracked(base):
expected += struct.calcsize('2Pn') # PyGC_Head expected += self.gc_headsize
self.assertEqual(sys.getsizeof(obj), expected) self.assertEqual(sys.getsizeof(obj), expected)
def test_slots(self): def test_slots(self):