Issue #11386: Fixed the exception thrown by bytearray.pop() for empty bytearrays

This commit is contained in:
Eli Bendersky 2011-03-04 04:55:25 +00:00
parent 424298a155
commit 1bc4f193d8
3 changed files with 6 additions and 3 deletions

View file

@ -2309,8 +2309,8 @@ bytearray_pop(PyByteArrayObject *self, PyObject *args)
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)