summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2004-10-14 03:46:18 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2004-10-14 03:46:18 (GMT)
commit64fa74df21d1eed5fb90ab6b900c2080ab8df992 (patch)
treee2f5bcea9844e4498ecd69a8848b385b9515f326
parent371e4d895ba343cf653233d0053bc83b22d8d8b3 (diff)
downloadcpython-64fa74df21d1eed5fb90ab6b900c2080ab8df992.zip
cpython-64fa74df21d1eed5fb90ab6b900c2080ab8df992.tar.gz
cpython-64fa74df21d1eed5fb90ab6b900c2080ab8df992.tar.bz2
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
-rw-r--r--Lib/test/test_xrange.py9
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():