Skip to content

Commit 8a189d8

Browse files
Address review
1 parent eb71cca commit 8a189d8

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Objects/listobject.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,9 +1437,9 @@ list_extend_dictitems(PyListObject *self, PyDictObject *dict)
14371437
PyObject **dest = self->ob_item + m;
14381438
Py_ssize_t pos = 0;
14391439
Py_ssize_t i = 0;
1440-
PyObject *key_value[2];
1441-
while (_PyDict_Next((PyObject *)dict, &pos, &key_value[0], &key_value[1], NULL)) {
1442-
PyObject *item = _PyTuple_FromPair(key_value[0], key_value[1]);
1440+
PyObject *key, *value;
1441+
while (_PyDict_Next((PyObject *)dict, &pos, &key, &value, NULL)) {
1442+
PyObject *item = _PyTuple_FromPair(key, value);
14431443
if (item == NULL) {
14441444
Py_SET_SIZE(self, m + i);
14451445
return -1;

Objects/stringlib/unicode_format.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,21 +1173,21 @@ fieldnameiter_next(PyObject *op)
11731173

11741174
is_attr_obj = PyBool_FromLong(is_attr);
11751175
if (is_attr_obj == NULL)
1176-
goto done;
1176+
goto error;
11771177

11781178
/* either an integer or a string */
11791179
if (idx != -1)
11801180
obj = PyLong_FromSsize_t(idx);
11811181
else
11821182
obj = SubString_new_object(&name);
11831183
if (obj == NULL)
1184-
goto done;
1184+
goto error;
11851185

11861186
/* return a tuple of values */
11871187
result = _PyTuple_FromPairSteal(is_attr_obj, obj);
11881188
return result;
11891189

1190-
done:
1190+
error:
11911191
Py_XDECREF(is_attr_obj);
11921192
Py_XDECREF(obj);
11931193
return result;
@@ -1264,7 +1264,7 @@ formatter_field_name_split(PyObject *Py_UNUSED(module), PyObject *self)
12641264
first_obj in that case. */
12651265
if (!field_name_split((PyObject*)self, 0, PyUnicode_GET_LENGTH(self),
12661266
&first, &first_idx, &it->it_field, NULL))
1267-
goto done;
1267+
goto error;
12681268

12691269
/* first becomes an integer, if possible; else a string */
12701270
if (first_idx != -1)
@@ -1273,13 +1273,13 @@ formatter_field_name_split(PyObject *Py_UNUSED(module), PyObject *self)
12731273
/* convert "first" into a string object */
12741274
first_obj = SubString_new_object(&first);
12751275
if (first_obj == NULL)
1276-
goto done;
1276+
goto error;
12771277

12781278
/* return a tuple of values */
12791279
result = _PyTuple_FromPairSteal(first_obj, (PyObject *)it);
12801280
return result;
12811281

1282-
done:
1282+
error:
12831283
Py_XDECREF(it);
12841284
Py_XDECREF(first_obj);
12851285
return result;

0 commit comments

Comments
 (0)