fix bytes indexing
authorStefan Behnel <scoder@users.berlios.de>
Mon, 26 Apr 2010 06:38:24 +0000 (08:38 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Mon, 26 Apr 2010 06:38:24 +0000 (08:38 +0200)
Cython/Compiler/Optimize.py

index 931285635ce29982bfe02fd9f46d0136505a9968..3a2262d8c35d6b3dcf166775d1121517bfcfa4f9 100644 (file)
@@ -1226,7 +1226,7 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
                     coerce_node.pos, "__Pyx_PyUnicode_GetItemInt",
                     self.PyUnicode_GetItemInt_func_type,
                     args = [
-                        arg.base.as_none_safe_node(env),
+                        arg.base.as_none_safe_node("'NoneType' object is not subscriptable"),
                         index_node.coerce_to(PyrexTypes.c_py_ssize_t_type, env),
                         bound_check_node,
                         ],
@@ -1242,7 +1242,7 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
                     coerce_node.pos, "__Pyx_PyBytes_GetItemInt",
                     self.PyBytes_GetItemInt_func_type,
                     args = [
-                        arg.base.as_none_safe_node(env),
+                        arg.base.as_none_safe_node("'NoneType' object is not subscriptable"),
                         index_node.coerce_to(PyrexTypes.c_py_ssize_t_type, env),
                         bound_check_node,
                         ],