]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Hold key reference until the links have updated.
authorRaymond Hettinger <python@rcn.com>
Sat, 23 Mar 2013 12:27:51 +0000 (05:27 -0700)
committerRaymond Hettinger <python@rcn.com>
Sat, 23 Mar 2013 12:27:51 +0000 (05:27 -0700)
Lib/collections.py

index a0922412d7fd553680588efbf911c529e5b3af73..faf677b7bf722bf32a920ba3f4a06cbfd8919113 100644 (file)
@@ -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]