From: Raymond Hettinger Date: Sat, 23 Mar 2013 12:27:51 +0000 (-0700) Subject: Hold key reference until the links have updated. X-Git-Tag: v2.7.4rc1~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5ded795a72d6de03066ee5975c85501612d11d8f;p=thirdparty%2FPython%2Fcpython.git Hold key reference until the links have updated. --- diff --git a/Lib/collections.py b/Lib/collections.py index a0922412d7fd..faf677b7bf72 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]