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

Tres Seaver tseaver@zope.com
Fri, 12 Oct 2001 09:03:36 -0400


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

Modified Files:
      Tag: tseaver-testfixup-branch
	TextIndex.py 
Log Message:
 - 'isinstance' can't be applied to types, only instances.

=== Zope/lib/python/Products/PluginIndexes/TextIndex/TextIndex.py 1.19 => 1.19.2.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,8 +630,8 @@
         operandType = type(left)
         if operandType is IntType:
             left = self[left]
-        elif isinstance(operandType,StringType) or \
-             isinstance(operandType,UnicodeType):
+        elif isinstance(left,StringType) or \
+             isinstance(left,UnicodeType):
             left = self[left]        
         elif operandType is ListType:
             left = self.evaluate(left)
@@ -640,8 +639,8 @@
         operandType = type(right)
         if operandType is IntType:
             right = self[right]
-        elif isinstance(operandType,StringType) or \
-             isinstance(operandType,UnicodeType):
+        elif isinstance(right,StringType) or \
+             isinstance(right,UnicodeType):
             right = self[right]       
         elif operandType is ListType:
             right = self.evaluate(right)