summaryrefslogtreecommitdiff
path: root/Objects/odictobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/odictobject.c')
-rw-r--r--Objects/odictobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/odictobject.c b/Objects/odictobject.c
index 33af1d1d52..4976b70b5d 100644
--- a/Objects/odictobject.c
+++ b/Objects/odictobject.c
@@ -1114,8 +1114,7 @@ OrderedDict_popitem_impl(PyODictObject *self, int last)
}
node = last ? _odict_LAST(self) : _odict_FIRST(self);
- key = _odictnode_KEY(node);
- Py_INCREF(key);
+ key = Py_NewRef(_odictnode_KEY(node));
value = _odict_popkey_hash((PyObject *)self, key, NULL, _odictnode_HASH(node));
if (value == NULL)
return NULL;