Addressed PR comments.

pull/13171/head
Joshua Haberman 3 years ago
parent f6e76190e1
commit 2a87c3ddb8
  1. 4
      python/repeated.c

@ -316,8 +316,8 @@ static int PyUpb_RepeatedContainer_SetSubscript(
PyObject* seq =
PySequence_Fast(value, "must assign iterable to extended slice");
PyObject* item = NULL;
if (!seq) goto err;
int ret = -1;
if (!seq) goto err;
if (PySequence_Size(seq) != count) {
PyErr_Format(PyExc_ValueError,
"attempt to assign sequence of size %zd to extended slice "
@ -331,6 +331,8 @@ static int PyUpb_RepeatedContainer_SetSubscript(
if (!item) goto err;
// XXX: if this fails we can leave the list partially mutated.
if (!PyUpb_PyToUpb(item, f, &msgval, arena)) goto err;
Py_DECREF(item);
item = NULL;
upb_array_set(arr, idx, msgval);
}
ret = 0;

Loading…
Cancel
Save