[Zope-Checkins] CVS: Zope/lib/python/Products/ZCTextIndex - Lexicon.py:1.18.26.5

Casey Duncan casey@zope.com
Thu, 5 Jun 2003 12:04:57 -0400


Update of /cvs-repository/Zope/lib/python/Products/ZCTextIndex
In directory cvs.zope.org:/tmp/cvs-serv22205

Modified Files:
      Tag: casey-zctextindex-fewer-conflicts-branch
	Lexicon.py 
Log Message:
Make sure lexicon.length attr is overridden in older lexicon instances
Add test for this


=== Zope/lib/python/Products/ZCTextIndex/Lexicon.py 1.18.26.4 => 1.18.26.5 ===
--- Zope/lib/python/Products/ZCTextIndex/Lexicon.py:1.18.26.4	Thu Jun  5 11:38:04 2003
+++ Zope/lib/python/Products/ZCTextIndex/Lexicon.py	Thu Jun  5 12:04:25 2003
@@ -59,6 +59,9 @@
         last = _text2list(text)
         for element in self._pipeline:
             last = element.process(last)
+        if not hasattr(self.length, 'change'):
+            # Make sure length is overridden with a BTrees.Length.Length
+            self.length = Length(self.length())        
         # Strategically unload the length value so that we get the most
         # recent value written to the database to minimize conflicting wids
         # XXX this will not work when MVCC is implemented in the ZODB...