summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-06-26 20:17:00 (GMT)
committerGitHub <noreply@github.com>2019-06-26 20:17:00 (GMT)
commit5c4ce3e2fa73125fb6f9c501e6c4c8512216b7e1 (patch)
tree7e29931823996bffaa8b59bbe69bdf63f40334d2 /Objects
parentbdbd5e895ddf9aefcb79cdc52341f0697ad6aea0 (diff)
downloadcpython-5c4ce3e2fa73125fb6f9c501e6c4c8512216b7e1.zip
cpython-5c4ce3e2fa73125fb6f9c501e6c4c8512216b7e1.tar.gz
cpython-5c4ce3e2fa73125fb6f9c501e6c4c8512216b7e1.tar.bz2
bpo-37417: Fix error handling in bytearray.extend. (GH-14407)
(cherry picked from commit 2a7d596f27b2342caf168a03c95ebf3b56e5dbbd) Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Diffstat (limited to 'Objects')
-rw-r--r--Objects/bytearrayobject.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
index c684db7..1bb19a9 100644
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -1698,6 +1698,10 @@ bytearray_extend(PyByteArrayObject *self, PyObject *iterable_of_ints)
}
Py_DECREF(bytearray_obj);
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+
Py_RETURN_NONE;
}