[Python-checkins] gh-97616: test_list_resize_overflow() uses sys.maxsize (#99057)

vstinner webhook-mailer at python.org
Thu Nov 3 10:56:19 EDT 2022


https://github.com/python/cpython/commit/b8a9f13abb61bd91a368e2d3f339de736863050f
commit: b8a9f13abb61bd91a368e2d3f339de736863050f
branch: main
author: Victor Stinner <vstinner at python.org>
committer: vstinner <vstinner at python.org>
date: 2022-11-03T15:56:12+01:00
summary:

gh-97616: test_list_resize_overflow() uses sys.maxsize (#99057)

files:
M Lib/test/test_list.py

diff --git a/Lib/test/test_list.py b/Lib/test/test_list.py
index 9aa6dd109566..2969c6e2f98a 100644
--- a/Lib/test/test_list.py
+++ b/Lib/test/test_list.py
@@ -103,7 +103,7 @@ def test_list_resize_overflow(self):
         del lst[1:]
         self.assertEqual(len(lst), 1)
 
-        size = ((2 ** (tuple.__itemsize__ * 8) - 1) // 2)
+        size = sys.maxsize
         with self.assertRaises((MemoryError, OverflowError)):
             lst * size
         with self.assertRaises((MemoryError, OverflowError)):



More information about the Python-checkins mailing list