Issue #6846: bytearray.pop was returning ints in the range [-128, 128)

instead of [0, 256).  Thanks Hagen Fürstenau for the report and fix.
This commit is contained in:
Mark Dickinson 2009-09-06 10:03:31 +00:00
parent 2596758cb4
commit c8a7c7c3b9
3 changed files with 5 additions and 1 deletions

View file

@ -690,6 +690,8 @@ class ByteArrayTest(BaseBytesTest):
self.assertEqual(b.pop(-2), ord('r'))
self.assertRaises(IndexError, lambda: b.pop(10))
self.assertRaises(OverflowError, lambda: bytearray().pop())
# test for issue #6846
self.assertEqual(bytearray(b'\xff').pop(), 0xff)
def test_nosort(self):
self.assertRaises(AttributeError, lambda: bytearray().sort())