python3.11/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch

22 lines
1.1 KiB
Diff
Raw Normal View History

diff -up Python-3.3.0b1/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sys Python-3.3.0b1/Lib/test/test_sys.py
2012-07-23 15:27:17 +00:00
--- Python-3.3.0b1/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sys 2012-07-23 11:18:52.524602807 -0400
+++ Python-3.3.0b1/Lib/test/test_sys.py 2012-07-23 11:25:54.641325620 -0400
@@ -863,12 +863,17 @@ class SizeofTest(unittest.TestCase):
# type
# static type: PyTypeObject
s = size(vh + 'P2P15Pl4PP9PP11PI')
+ # COUNT_ALLOCS adds a further 3 Py_ssize_t and 2 pointers:
+ if hasattr(sys, 'getcounts'):
+ s += size('3P2P')
check(int, s)
# (PyTypeObject + PyNumberMethods + PyMappingMethods +
# PySequenceMethods + PyBufferProcs + 4P)
s = size(vh + 'P2P15Pl4PP9PP11PI') + size('34P 3P 10P 2P 4P')
# Separate block for PyDictKeysObject with 4 entries
s += size("PPPP") + 4*size("PPP")
+ if hasattr(sys, 'getcounts'):
+ s += size('3P2P')
# class
class newstyleclass(object): pass
check(newstyleclass, s)