summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bytes.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-12-04 23:02:19 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-12-04 23:02:19 (GMT)
commita37d4c693a024154093b36a612810c3bd72d9254 (patch)
treed8c061b9356d7bf8f444bcfd7869c1ac5bec9f3c /Lib/test/test_bytes.py
parent327858ef2c4512937a1333212a3b46a62c18ccc3 (diff)
downloadcpython-a37d4c693a024154093b36a612810c3bd72d9254.zip
cpython-a37d4c693a024154093b36a612810c3bd72d9254.tar.gz
cpython-a37d4c693a024154093b36a612810c3bd72d9254.tar.bz2
Removed PyInt_GetMax and sys.maxint
I replaced sys.maxint with sys.maxsize in Lib/*.py. Does anybody see a problem with the change on Win 64bit platforms? Win 64's long is just 32bit but the sys.maxsize is now 2**63-1 on every 64bit platform. Also added docs for sys.maxsize.
Diffstat (limited to 'Lib/test/test_bytes.py')
-rw-r--r--Lib/test/test_bytes.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index f037d4c..0fd2f76 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -36,14 +36,14 @@ class BytesTest(unittest.TestCase):
self.assertEqual(len(b), 0)
self.assertRaises(IndexError, lambda: b[0])
self.assertRaises(IndexError, lambda: b[1])
- self.assertRaises(IndexError, lambda: b[sys.maxint])
- self.assertRaises(IndexError, lambda: b[sys.maxint+1])
+ self.assertRaises(IndexError, lambda: b[sys.maxsize])
+ self.assertRaises(IndexError, lambda: b[sys.maxsize+1])
self.assertRaises(IndexError, lambda: b[10**100])
self.assertRaises(IndexError, lambda: b[-1])
self.assertRaises(IndexError, lambda: b[-2])
- self.assertRaises(IndexError, lambda: b[-sys.maxint])
- self.assertRaises(IndexError, lambda: b[-sys.maxint-1])
- self.assertRaises(IndexError, lambda: b[-sys.maxint-2])
+ self.assertRaises(IndexError, lambda: b[-sys.maxsize])
+ self.assertRaises(IndexError, lambda: b[-sys.maxsize-1])
+ self.assertRaises(IndexError, lambda: b[-sys.maxsize-2])
self.assertRaises(IndexError, lambda: b[-10**100])
def test_from_list(self):
@@ -83,14 +83,14 @@ class BytesTest(unittest.TestCase):
def test_constructor_value_errors(self):
self.assertRaises(ValueError, bytearray, [-1])
- self.assertRaises(ValueError, bytearray, [-sys.maxint])
- self.assertRaises(ValueError, bytearray, [-sys.maxint-1])
- self.assertRaises(ValueError, bytearray, [-sys.maxint-2])
+ self.assertRaises(ValueError, bytearray, [-sys.maxsize])
+ self.assertRaises(ValueError, bytearray, [-sys.maxsize-1])
+ self.assertRaises(ValueError, bytearray, [-sys.maxsize-2])
self.assertRaises(ValueError, bytearray, [-10**100])
self.assertRaises(ValueError, bytearray, [256])
self.assertRaises(ValueError, bytearray, [257])
- self.assertRaises(ValueError, bytearray, [sys.maxint])
- self.assertRaises(ValueError, bytearray, [sys.maxint+1])
+ self.assertRaises(ValueError, bytearray, [sys.maxsize])
+ self.assertRaises(ValueError, bytearray, [sys.maxsize+1])
self.assertRaises(ValueError, bytearray, [10**100])
def test_repr_str(self):
@@ -412,7 +412,7 @@ class BytesTest(unittest.TestCase):
self.assertRaises(TypeError, lambda: 3.14 * b)
# XXX Shouldn't bytes and bytearray agree on what to raise?
self.assertRaises((OverflowError, MemoryError),
- lambda: b * sys.maxint)
+ lambda: b * sys.maxsize)
def test_repeat_1char(self):
self.assertEqual(b'x'*100, bytearray([ord('x')]*100))