[Spambayes-checkins] spambayes storage.py,1.4,1.5

Neale Pickett npickett@users.sourceforge.net
Mon Dec 2 06:02:05 2002


Update of /cvsroot/spambayes/spambayes
In directory sc8-pr-cvs1:/tmp/cvs-serv15502

Modified Files:
	storage.py 
Log Message:
* storage.DBDictClassifier.store() now iterates over a list, not a
  generator.  The latter was causing problems when removing keys.


Index: storage.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/storage.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** storage.py	27 Nov 2002 23:04:14 -0000	1.4
--- storage.py	2 Dec 2002 06:02:03 -0000	1.5
***************
*** 156,160 ****
              print 'Persisting',self.db_name,'state in database'
  
!         for key, val in self.wordinfo.iteritems():
              if val == None:
                  del self.wordinfo[key]
--- 156,162 ----
              print 'Persisting',self.db_name,'state in database'
  
!         # Must use .keys() since we modify the dict in the loop
!         for key in self.wordinfo.keys():
!             val = self.wordinfo[key]
              if val == None:
                  del self.wordinfo[key]





More information about the Spambayes-checkins mailing list