[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndex - TextIndex.py:1.26
Andreas Jung
andreas@digicool.com
Mon, 18 Feb 2002 10:42:42 -0500
Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TextIndex
In directory cvs.zope.org:/tmp/cvs-serv27284/lib/python/Products/PluginIndexes/TextIndex
Modified Files:
TextIndex.py
Log Message:
- Collector #227: improved handling of unicode string in TextIndex.py
with unmodified default encoding in site.py.
=== Zope/lib/python/Products/PluginIndexes/TextIndex/TextIndex.py 1.25 => 1.26 ===
source = getattr(obj, self.id)
if callable(source):
- source = str(source())
- else:
+ source = source()
+
+ if not isinstance(source, UnicodeType):
source = str(source)
+
except (AttributeError, TypeError):
return 0