summaryrefslogtreecommitdiffstats
path: root/Objects/bytearrayobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/bytearrayobject.c')
-rw-r--r--Objects/bytearrayobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
index 4e2bb60..58fe53b 100644
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -41,7 +41,6 @@ _getbytevalue(PyObject* arg, int *value)
} else {
PyObject *index = PyNumber_Index(arg);
if (index == NULL) {
- PyErr_Format(PyExc_TypeError, "an integer is required");
*value = -1;
return 0;
}
@@ -821,7 +820,7 @@ bytearray_init(PyByteArrayObject *self, PyObject *args, PyObject *kwds)
if (PyIndex_Check(arg)) {
count = PyNumber_AsSsize_t(arg, PyExc_OverflowError);
if (count == -1 && PyErr_Occurred()) {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
+ if (!PyErr_ExceptionMatches(PyExc_TypeError))
return -1;
PyErr_Clear(); /* fall through */
}