mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
merge 3.5
This commit is contained in:
commit
9c474172cb
1 changed files with 6 additions and 2 deletions
|
@ -2427,12 +2427,16 @@ mutablemapping_update(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||||
else if (PyObject_HasAttrString(other, "keys")) { /* never fails */
|
else if (PyObject_HasAttrString(other, "keys")) { /* never fails */
|
||||||
PyObject *keys, *iterator, *key;
|
PyObject *keys, *iterator, *key;
|
||||||
keys = PyObject_CallMethod(other, "keys", NULL);
|
keys = PyObject_CallMethod(other, "keys", NULL);
|
||||||
if (keys == NULL)
|
if (keys == NULL) {
|
||||||
|
Py_DECREF(other);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
iterator = PyObject_GetIter(keys);
|
iterator = PyObject_GetIter(keys);
|
||||||
Py_DECREF(keys);
|
Py_DECREF(keys);
|
||||||
if (iterator == NULL)
|
if (iterator == NULL) {
|
||||||
|
Py_DECREF(other);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
while (res == 0 && (key = PyIter_Next(iterator))) {
|
while (res == 0 && (key = PyIter_Next(iterator))) {
|
||||||
PyObject *value = PyObject_GetItem(other, key);
|
PyObject *value = PyObject_GetItem(other, key);
|
||||||
if (value != NULL) {
|
if (value != NULL) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue