Fix slicing tests.
authorRobert Bradshaw <robertwb@math.washington.edu>
Thu, 9 Sep 2010 08:02:43 +0000 (01:02 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Thu, 9 Sep 2010 08:02:43 +0000 (01:02 -0700)
Cython/Compiler/ExprNodes.py

index 1ab47bf9af7a62542599d3002e72eeb978272eba..ddce68088c8431c024865879328898c0b366c2a1 100755 (executable)
@@ -2011,7 +2011,7 @@ class IndexNode(ExprNode):
 
         # Handle the case where base is a literal char* (and we expect a string, not an int)
         if isinstance(self.base, BytesNode) or is_slice:
-            if not (self.base.type.is_ptr or self.base.type.is_array):
+            if self.base.type.is_string or not (self.base.type.is_ptr or self.base.type.is_array):
                 self.base = self.base.coerce_to_pyobject(env)
 
         skip_child_analysis = False