mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Issue #27039: Fixed bytearray.remove() for values greater than 127.
Patch by Joe Jevnik.
This commit is contained in:
parent
dc953a5078
commit
7bf36dace8
3 changed files with 14 additions and 7 deletions
|
@ -1082,6 +1082,13 @@ class ByteArrayTest(BaseBytesTest, unittest.TestCase):
|
|||
b.remove(Indexable(ord('e')))
|
||||
self.assertEqual(b, b'')
|
||||
|
||||
# test values outside of the ascii range: (0, 127)
|
||||
c = bytearray([126, 127, 128, 129])
|
||||
c.remove(127)
|
||||
self.assertEqual(c, bytes([126, 128, 129]))
|
||||
c.remove(129)
|
||||
self.assertEqual(c, bytes([126, 128]))
|
||||
|
||||
def test_pop(self):
|
||||
b = bytearray(b'world')
|
||||
self.assertEqual(b.pop(), ord('d'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue