[Python-checkins] CVS: python/dist/src/Lib weakref.py,1.10,1.11

Fred L. Drake fdrake@users.sourceforge.net
Thu, 02 Aug 2001 21:11:29 -0700


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

Modified Files:
	weakref.py 
Log Message:

Make sure that WeakValueDictionary[] raises KeyError instead of TypeError
for keys that are not in the dictionary.


Index: weakref.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/weakref.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** weakref.py	2001/05/02 05:43:09	1.10
--- weakref.py	2001/08/03 04:11:27	1.11
***************
*** 42,46 ****
  
      def __getitem__(self, key):
!         o = self.data.get(key)()
          if o is None:
              raise KeyError, key
--- 42,46 ----
  
      def __getitem__(self, key):
!         o = self.data[key]()
          if o is None:
              raise KeyError, key