Index: Objects/bytearrayobject.c =================================================================== --- Objects/bytearrayobject.c (revision 88733) +++ Objects/bytearrayobject.c (working copy) @@ -2309,8 +2309,8 @@ return NULL; if (n == 0) { - PyErr_SetString(PyExc_OverflowError, - "cannot pop an empty bytearray"); + PyErr_SetString(PyExc_IndexError, + "pop from empty bytearray"); return NULL; } if (where < 0) Index: Misc/NEWS =================================================================== --- Misc/NEWS (revision 88733) +++ Misc/NEWS (working copy) @@ -49,6 +49,9 @@ - Issue #10516: New copy() and clear() methods for lists and bytearrays. +- Issue #11386: bytearray.pop() now throws IndexError when the bytearray is + empty, instead of OverflowError. + Library ------- Index: Lib/test/test_bytes.py =================================================================== --- Lib/test/test_bytes.py (revision 88733) +++ Lib/test/test_bytes.py (working copy) @@ -790,7 +790,7 @@ self.assertEqual(b.pop(0), ord('w')) self.assertEqual(b.pop(-2), ord('r')) self.assertRaises(IndexError, lambda: b.pop(10)) - self.assertRaises(OverflowError, lambda: bytearray().pop()) + self.assertRaises(IndexError, lambda: bytearray().pop()) # test for issue #6846 self.assertEqual(bytearray(b'\xff').pop(), 0xff)