From 64fa74df21d1eed5fb90ab6b900c2080ab8df992 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Thu, 14 Oct 2004 03:46:18 +0000 Subject: Get test to pass on amd64 (opteron). This is pretty hacky, but rangeobject.c has an #ifdef that is reached only when LONG_MAX != INT_MAX --- Lib/test/test_xrange.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_xrange.py b/Lib/test/test_xrange.py index f33373e..9f9daa7 100644 --- a/Lib/test/test_xrange.py +++ b/Lib/test/test_xrange.py @@ -53,8 +53,13 @@ class XrangeTest(unittest.TestCase): self.assertRaises(OverflowError, xrange, -sys.maxint, sys.maxint) self.assertRaises(OverflowError, xrange, 0, 2*sys.maxint) - self.assertEqual(len(xrange(-sys.maxint, sys.maxint, 2)), - sys.maxint) + r = xrange(-sys.maxint, sys.maxint, 2) + if sys.maxint > 0x7fffffff: + # XXX raising ValueError is less than ideal, but this can't + # be fixed until range_length() returns a long in rangeobject.c + self.assertRaises(ValueError, len, r) + else: + self.assertEqual(len(r), sys.maxint) self.assertRaises(OverflowError, xrange, -sys.maxint-1, sys.maxint, 2) def test_main(): -- cgit v0.12