There was an error while loading. Please reload this page.
1 parent 6b5e4a8 commit b46ea90Copy full SHA for b46ea90
3 files changed
Lib/collections/__init__.py
@@ -189,19 +189,22 @@ def move_to_end(self, key, last=True):
189
link = self.__map[key]
190
link_prev = link.prev
191
link_next = link.next
192
+ soft_link = link_next.prev
193
link_prev.next = link_next
194
link_next.prev = link_prev
195
root = self.__root
196
if last:
197
last = root.prev
198
link.prev = last
199
link.next = root
- last.next = root.prev = link
200
+ root.prev = soft_link
201
+ last.next = link
202
else:
203
first = root.next
204
link.prev = root
205
link.next = first
- root.next = first.prev = link
206
+ first.prev = soft_link
207
+ root.next = link
208
209
def __sizeof__(self):
210
sizeof = _sys.getsizeof
Misc/ACKS
@@ -156,6 +156,7 @@ Finn Bock
156
Paul Boddie
157
Matthew Boedicker
158
Robin Boerdijk
159
+Andra Bogildea
160
David Bolen
161
Wouter Bolsterlee
162
Gawain Bolton
Misc/NEWS
@@ -143,6 +143,10 @@ Library
143
- Issue #13051: Fixed recursion errors in large or resized
144
curses.textpad.Textbox. Based on patch by Tycho Andersen.
145
146
+- Issue #29119: Fix weakrefs in the pure python version of
147
+ collections.OrderedDict move_to_end() method.
148
+ Contributed by Andra Bogildea.
149
+
150
- Issue #9770: curses.ascii predicates now work correctly with negative
151
integers.
152
0 commit comments