[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndex - TextIndex.py:1.22
Tres Seaver
tseaver@zope.com
Wed, 17 Oct 2001 16:01:04 -0400
Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TextIndex
In directory cvs.zope.org:/tmp/cvs-serv30119/lib/python/Products/PluginIndexes/TextIndex
Modified Files:
TextIndex.py
Log Message:
o Land unit test cleanup from branch.
o Known breakage as of 2001/10/17:
- TAL test suite is very broken (TAL is currently suppressed in
lib/python/.testinfo).
- AccessControl tests don't run if run first; lib/python/.testinfo
pushes them to the end of the queue, at which point they *do* run.
Global side effects suck!
- lib/python/BTrees/testBTreesUnicode.py: weird flakiness around
comparison of ASCII and Unicode strings; breaks in different
ways under Python 2.1 and 2.2.
- lib/python/Products/PageTemplates/tests: three tests break due
to security asserctions.
=== Zope/lib/python/Products/PluginIndexes/TextIndex/TextIndex.py 1.21 => 1.22 ===
def get_operands(self, q, i):
"""Evaluate and return the left and right operands for an operator"""
-
try:
left = q[i - 1]
right = q[i + 1]
@@ -643,7 +642,7 @@
operandType = type(left)
if operandType is IntType:
left = self[left]
- elif operandType in (StringType,UnicodeType):
+ elif isinstance(left,StringType) or isinstance(left,UnicodeType):
left = self[left]
elif operandType is ListType:
left = self.evaluate(left)
@@ -651,7 +650,7 @@
operandType = type(right)
if operandType is IntType:
right = self[right]
- elif operandType in (StringType,UnicodeType):
+ elif isinstance(right,StringType) or isinstance(right,UnicodeType):
right = self[right]
elif operandType is ListType:
right = self.evaluate(right)