mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
GH-95707: Fix uses of Py_TPFLAGS_MANAGED_DICT
(GH-95854)
* Make sure that tp_dictoffset is correct with Py_TPFLAGS_MANAGED_DICT is set. * Avoid traversing managed dict twice when subclassing class with Py_TPFLAGS_MANAGED_DICT set.
This commit is contained in:
parent
4a7f5a55dc
commit
3ef3c6306d
7 changed files with 137 additions and 25 deletions
|
@ -1287,7 +1287,7 @@ class SizeofTest(unittest.TestCase):
|
|||
def __sizeof__(self):
|
||||
return int(self)
|
||||
self.assertEqual(sys.getsizeof(OverflowSizeof(sys.maxsize)),
|
||||
sys.maxsize + self.gc_headsize)
|
||||
sys.maxsize + self.gc_headsize*2)
|
||||
with self.assertRaises(OverflowError):
|
||||
sys.getsizeof(OverflowSizeof(sys.maxsize + 1))
|
||||
with self.assertRaises(ValueError):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue