diff options
-rw-r--r-- | Lib/test/test_xrange.py | 9 |
1 files 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(): |