From cfac1d4a1894789cc52e77723c9008f300a9050b Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Tue, 8 Oct 2002 21:01:07 +0000 Subject: [PATCH] The list(xrange(sys.maxint / 4)) test. Changed 4 to 2. The belief is that this test intended to trigger a bit of code in listobject.c's NRESIZE macro that's looking for arithmetic overflow. As written, it doesn't achieve that, though, and leaves it up to the platform realloc() as to whether it wants to allocate 2 gigabytes. Some platforms say "sure!", although they don't appear to mean it, and disaster ensues. Changing 4 to 2 (just barely) manages to trigger the arithmetic overflow test instead, leaving the platform realloc() out of it. I'll backport this to the 2.2 branch next. --- Lib/test/test_b1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_b1.py b/Lib/test/test_b1.py index c90cadb442e..65285ee7377 100644 --- a/Lib/test/test_b1.py +++ b/Lib/test/test_b1.py @@ -549,7 +549,7 @@ if sys.maxint == 0x7fffffff: # thread for the details: # http://sources.redhat.com/ml/newlib/2002/msg00369.html - list(xrange(sys.maxint / 4)) + list(xrange(sys.maxint // 2)) except MemoryError: pass else: