[Zope-Checkins] CVS: Zope/lib/python/Products/ZCTextIndex/tests - mhindex.py:1.18
Guido van Rossum
guido@python.org
Tue, 3 Dec 2002 16:30:28 -0500
Update of /cvs-repository/Zope/lib/python/Products/ZCTextIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv32284
Modified Files:
mhindex.py
Log Message:
Fix a bug in unindexing removed messages (it was iterating over a lazy
list that was being modified as we went).
[Backport from Zope3; I'm not actually sure if the list returned by
**Btree.keys() is lazy, but I assume it is.]
=== Zope/lib/python/Products/ZCTextIndex/tests/mhindex.py 1.17 => 1.18 ===
--- Zope/lib/python/Products/ZCTextIndex/tests/mhindex.py:1.17 Tue Oct 15 20:38:16 2002
+++ Zope/lib/python/Products/ZCTextIndex/tests/mhindex.py Tue Dec 3 16:30:28 2002
@@ -468,7 +468,7 @@
self.index.index_text(docid, text)
self.maycommit()
# Remove messages from the folder that no longer exist
- for path in self.path2docid.keys(f.name):
+ for path in list(self.path2docid.keys(f.name)):
if not path.startswith(f.name + "/"):
break
if self.getmtime(path) == 0: