Commit f0e0be87 authored by Georg Brandl's avatar Georg Brandl

Bug #1196315: fix weakref.WeakValueDictionary constructor.

parent 3af8d69f
...@@ -43,12 +43,12 @@ class WeakValueDictionary(UserDict.UserDict): ...@@ -43,12 +43,12 @@ class WeakValueDictionary(UserDict.UserDict):
# way in). # way in).
def __init__(self, *args, **kw): def __init__(self, *args, **kw):
UserDict.UserDict.__init__(self, *args, **kw)
def remove(wr, selfref=ref(self)): def remove(wr, selfref=ref(self)):
self = selfref() self = selfref()
if self is not None: if self is not None:
del self.data[wr.key] del self.data[wr.key]
self._remove = remove self._remove = remove
UserDict.UserDict.__init__(self, *args, **kw)
def __getitem__(self, key): def __getitem__(self, key):
o = self.data[key]() o = self.data[key]()
......
...@@ -141,6 +141,8 @@ Extension Modules ...@@ -141,6 +141,8 @@ Extension Modules
Library Library
------- -------
- Bug #1196315: fix weakref.WeakValueDictionary constructor.
- Bug #1213894: os.path.realpath didn't resolve symlinks that were the first - Bug #1213894: os.path.realpath didn't resolve symlinks that were the first
component of the path. 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