mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Bug #1196315: fix weakref.WeakValueDictionary constructor.
This commit is contained in:
parent
4c560ea05b
commit
9166e1a24a
2 changed files with 3 additions and 1 deletions
|
@ -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
|
||||||
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.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue