]> granicus.if.org Git - python/commitdiff
Bug #1196315: fix weakref.WeakValueDictionary constructor.
authorGeorg Brandl <georg@python.org>
Sat, 4 Jun 2005 09:20:03 +0000 (09:20 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 4 Jun 2005 09:20:03 +0000 (09:20 +0000)
Lib/weakref.py
Misc/NEWS

index c0669b03173e5ec46f3e318ca23431c40308d703..09bd0bee24d6feadfcc080c5d6f214b7f882541d 100644 (file)
@@ -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]()
index 637ca2eb130ae91a8d1040a7ac731387b7521a62..f15e87390b003f2106a6d93c65012fa7caa98d3a 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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.