[Python-checkins] python/dist/src/Lib weakref.py,1.15,1.15.8.1

mwh@users.sourceforge.net mwh@users.sourceforge.net
Fri, 23 Aug 2002 09:29:04 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv19097

Modified Files:
      Tag: release22-maint
	weakref.py 
Log Message:
backport gvanrossum's checkin of
    revision 1.17 of weakref.py

SF patch 564549 (Erik Andersén).

The WeakKeyDictionary constructor didn't work when a dict arg was
given.  Fixed by moving a line.  Also adding a unit test.

Bugfix candidate.


Index: weakref.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/weakref.py,v
retrieving revision 1.15
retrieving revision 1.15.8.1
diff -C2 -d -r1.15 -r1.15.8.1
*** weakref.py	6 Nov 2001 16:36:53 -0000	1.15
--- weakref.py	23 Aug 2002 16:29:01 -0000	1.15.8.1
***************
*** 145,149 ****
      def __init__(self, dict=None):
          self.data = {}
-         if dict is not None: self.update(dict)
          def remove(k, selfref=ref(self)):
              self = selfref()
--- 145,148 ----
***************
*** 151,154 ****
--- 150,154 ----
                  del self.data[k]
          self._remove = remove
+         if dict is not None: self.update(dict)
  
      def __delitem__(self, key):