From 5ded795a72d6de03066ee5975c85501612d11d8f Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 23 Mar 2013 05:27:51 -0700 Subject: Hold key reference until the links have updated. --- Lib/collections.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/collections.py b/Lib/collections.py index a092241..faf677b 100644 --- a/Lib/collections.py +++ b/Lib/collections.py @@ -66,7 +66,7 @@ class OrderedDict(dict): # Deleting an existing item uses self.__map to find the link which gets # removed by updating the links in the predecessor and successor nodes. dict_delitem(self, key) - link_prev, link_next, key = self.__map.pop(key) + link_prev, link_next, _ = self.__map.pop(key) link_prev[1] = link_next # update link_prev[NEXT] link_next[0] = link_prev # update link_next[PREV] -- cgit v0.12