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

Sidnei da Silva sidnei@x3ng.com.br
Tue, 17 Jun 2003 15:01:09 -0400


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

Modified Files:
	ZCTextIndex.py 
Log Message:
 - Made all PluginIndexes and ZCTextIndex use 'safe_callable',
        which is aware of extension classes that fill 'tp_callable'
        but don't define '__call__'.

      - Made KeywordIndex be more robust about receiving a value that
        is not a string or an iterable type.

=== Zope/lib/python/Products/ZCTextIndex/ZCTextIndex.py 1.47 => 1.48 ===
--- Zope/lib/python/Products/ZCTextIndex/ZCTextIndex.py:1.47	Thu Jun  5 15:43:54 2003
+++ Zope/lib/python/Products/ZCTextIndex/ZCTextIndex.py	Tue Jun 17 15:01:09 2003
@@ -30,6 +30,7 @@
 from Products.PluginIndexes.common.PluggableIndex import \
      PluggableIndexInterface
 from Products.PluginIndexes.common.util import parseIndexRequest
+from Products.PluginIndexes.common import safe_callable
 
 from Products.ZCTextIndex.ILexicon import ILexicon
 from Products.ZCTextIndex.Lexicon import \
@@ -168,7 +169,7 @@
         text = getattr(obj, self._fieldname, None)
         if text is None:
             return 0
-        if callable(text):
+        if safe_callable(text):
             text = text()
         if text is None:
             return 0