[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndex - TextIndex.py:1.20.4.1

Tres Seaver tseaver@zope.com
Mon, 15 Oct 2001 15:37:51 -0400


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TextIndex
In directory cvs.zope.org:/tmp/cvs-serv870/TextIndex

Modified Files:
      Tag: tseaver-utxfixup-branch
	TextIndex.py 
Log Message:


 - Merge specific fixes for PluginIndexes into general "test jihad" branch.


=== Zope/lib/python/Products/PluginIndexes/TextIndex/TextIndex.py 1.20 => 1.20.4.1 ===
     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]
@@ -631,7 +630,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)
@@ -639,7 +638,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)