[Python-checkins] python/dist/src/Lib weakref.py,1.16,1.17

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Mon, 10 Jun 2002 12:59:09 -0700


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

Modified Files:
	weakref.py 
Log Message:
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.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** weakref.py	1 Jun 2002 14:18:47 -0000	1.16
--- weakref.py	10 Jun 2002 19:59:04 -0000	1.17
***************
*** 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):