Skip to content

Commit 9166e1a

Browse files
committed
Bug #1196315: fix weakref.WeakValueDictionary constructor.
1 parent 4c560ea commit 9166e1a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Lib/weakref.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ class WeakValueDictionary(UserDict.UserDict):
4343
# way in).
4444

4545
def __init__(self, *args, **kw):
46-
UserDict.UserDict.__init__(self, *args, **kw)
4746
def remove(wr, selfref=ref(self)):
4847
self = selfref()
4948
if self is not None:
5049
del self.data[wr.key]
5150
self._remove = remove
51+
UserDict.UserDict.__init__(self, *args, **kw)
5252

5353
def __getitem__(self, key):
5454
o = self.data[key]()

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ Extension Modules
141141
Library
142142
-------
143143

144+
- Bug #1196315: fix weakref.WeakValueDictionary constructor.
145+
144146
- Bug #1213894: os.path.realpath didn't resolve symlinks that were the first
145147
component of the path.
146148

0 commit comments

Comments
 (0)