[Python-checkins] cpython (merge 3.6 -> default): merge

raymond.hettinger python-checkins at python.org
Sat Dec 31 14:03:25 EST 2016


https://hg.python.org/cpython/rev/c3a6e5fdfdc6
changeset:   105911:c3a6e5fdfdc6
parent:      105908:8b19c2a1b197
parent:      105910:1b4b00b370f7
user:        Raymond Hettinger <python at rcn.com>
date:        Sat Dec 31 12:03:16 2016 -0700
summary:
  merge

files:
  Lib/collections/__init__.py |  7 +++++--
  1 files changed, 5 insertions(+), 2 deletions(-)


diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -189,6 +189,7 @@
         link = self.__map[key]
         link_prev = link.prev
         link_next = link.next
+        soft_link = link_next.prev
         link_prev.next = link_next
         link_next.prev = link_prev
         root = self.__root
@@ -196,12 +197,14 @@
             last = root.prev
             link.prev = last
             link.next = root
-            last.next = root.prev = link
+            root.prev = soft_link
+            last.next = link
         else:
             first = root.next
             link.prev = root
             link.next = first
-            root.next = first.prev = link
+            first.prev = soft_link
+            root.next = link
 
     def __sizeof__(self):
         sizeof = _sys.getsizeof

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list