Make bytesobject raise ValueError instead of TypeError again (thanks, Nick)

This commit is contained in:
Thomas Wouters 2006-08-22 13:41:17 +00:00
parent 89da5d7c3d
commit d204a715f4
2 changed files with 8 additions and 8 deletions

View file

@ -60,13 +60,13 @@ class BytesTest(unittest.TestCase):
self.assertRaises(ValueError, bytes, [-1])
self.assertRaises(ValueError, bytes, [-sys.maxint])
self.assertRaises(ValueError, bytes, [-sys.maxint-1])
self.assertRaises(TypeError, bytes, [-sys.maxint-2])
self.assertRaises(TypeError, bytes, [-10**100])
self.assertRaises(ValueError, bytes, [-sys.maxint-2])
self.assertRaises(ValueError, bytes, [-10**100])
self.assertRaises(ValueError, bytes, [256])
self.assertRaises(ValueError, bytes, [257])
self.assertRaises(ValueError, bytes, [sys.maxint])
self.assertRaises(TypeError, bytes, [sys.maxint+1])
self.assertRaises(TypeError, bytes, [10**100])
self.assertRaises(ValueError, bytes, [sys.maxint+1])
self.assertRaises(ValueError, bytes, [10**100])
def test_repr(self):
self.assertEqual(repr(bytes()), "bytes()")