[Zope-Checkins] CVS: Zope2 - testCatalog.py:1.1.4.9

Andreas Jung andreas@dhcp165.digicool.com
Tue, 13 Mar 2001 17:45:13 -0500


Update of /mnt/cvs-repository/Zope2/lib/python/Products/ZCatalog/tests
In directory yetix:/work/Zope2/Catalog-BTrees-Integration/lib/python/Products/ZCatalog/tests

Modified Files:
      Tag: Catalog-BTrees-Integration
	testCatalog.py 
Log Message:
yet another try/except clause (zope mbox file seems to contain some sloppy
messages)



--- Updated File testCatalog.py in package Zope2 --
--- testCatalog.py	2001/03/13 22:04:20	1.1.4.8
+++ testCatalog.py	2001/03/13 22:45:07	1.1.4.9
@@ -7,6 +7,10 @@
     Andreas Jung, andreas@digicool.com
     
     $Log$
+    Revision 1.1.4.9  2001/03/13 22:45:07  andreas
+    yet another try/except clause (zope mbox file seems to contain some sloppy
+    messages)
+
     Revision 1.1.4.8  2001/03/13 22:04:20  andreas
     added try/except while reading and parsing the mbox file
 
@@ -168,17 +172,22 @@
 
             try:
                 self.catMessage(msg)
+                self.msg_ids.append(msg.dict["message-id"])
             except: 
                 msg = mb.next()
                 continue
 
-            self.msg_ids.append(msg.dict["message-id"])
 
             msg = mb.next()
             self.num_files = self.num_files + 1
             if self.num_files % 100==0: print self.num_files
+
+            try:
+                sub = string.split(msg.dict.get("subject",""))
+            except:
+                msg = mb.next()
+                continue
 
-            sub = string.split(msg.dict.get("subject",""))
             for s in sub: 
                 if not s in self.keywords: self.keywords.append(s)