mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Merged revisions 74167 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r74167 | georg.brandl | 2009-07-22 13:57:15 +0200 (Mi, 22 Jul 2009) | 1 line Issue #6540: Fixed crash for bytearray.translate() with invalid parameters. ........
This commit is contained in:
parent
2f19bb1447
commit
953152f064
3 changed files with 12 additions and 3 deletions
|
@ -1229,6 +1229,11 @@ class BuiltinTest(unittest.TestCase):
|
|||
self.assertEqual(bin(-(2**65)), '-0b1' + '0' * 65)
|
||||
self.assertEqual(bin(-(2**65-1)), '-0b' + '1' * 65)
|
||||
|
||||
def test_bytearray_translate(self):
|
||||
x = bytearray(b"abc")
|
||||
self.assertRaises(ValueError, x.translate, b"1", 1)
|
||||
self.assertRaises(TypeError, x.translate, b"1"*256, 1)
|
||||
|
||||
class TestSorted(unittest.TestCase):
|
||||
|
||||
def test_basic(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue