Commit 9166e1a2 authored by Georg Brandl's avatar Georg Brandl

Bug #1196315: fix weakref.WeakValueDictionary constructor.

parent 4c560ea0
......@@ -43,12 +43,12 @@ class WeakValueDictionary(UserDict.UserDict):
# way in).
def __init__(self, *args, **kw):
UserDict.UserDict.__init__(self, *args, **kw)
def remove(wr, selfref=ref(self)):
self = selfref()
if self is not None:
del self.data[wr.key]
self._remove = remove
UserDict.UserDict.__init__(self, *args, **kw)
def __getitem__(self, key):
o = self.data[key]()
......
......@@ -141,6 +141,8 @@ Extension Modules
Library
-------
- Bug #1196315: fix weakref.WeakValueDictionary constructor.
- Bug #1213894: os.path.realpath didn't resolve symlinks that were the first
component of the path.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment