[Python-checkins] cpython (merge 3.5 -> default): merge 3.5
benjamin.peterson
python-checkins at python.org
Thu Jun 4 21:34:55 CEST 2015
https://hg.python.org/cpython/rev/db08f902bb3a
changeset: 96515:db08f902bb3a
parent: 96513:c2c3b79ba992
parent: 96514:f86678551af2
user: Benjamin Peterson <benjamin at python.org>
date: Thu Jun 04 14:34:43 2015 -0500
summary:
merge 3.5
files:
Objects/odictobject.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/Objects/odictobject.c b/Objects/odictobject.c
--- a/Objects/odictobject.c
+++ b/Objects/odictobject.c
@@ -2427,12 +2427,16 @@
else if (PyObject_HasAttrString(other, "keys")) { /* never fails */
PyObject *keys, *iterator, *key;
keys = PyObject_CallMethod(other, "keys", NULL);
- if (keys == NULL)
+ if (keys == NULL) {
+ Py_DECREF(other);
return NULL;
+ }
iterator = PyObject_GetIter(keys);
Py_DECREF(keys);
- if (iterator == NULL)
+ if (iterator == NULL) {
+ Py_DECREF(other);
return NULL;
+ }
while (res == 0 && (key = PyIter_Next(iterator))) {
PyObject *value = PyObject_GetItem(other, key);
if (value != NULL) {
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list