From: Stefan Behnel Date: Mon, 26 Apr 2010 06:38:24 +0000 (+0200) Subject: fix bytes indexing X-Git-Tag: 0.13.beta0~143 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=26257b35a45e9bffef1668c573670089311d6caf;p=cython.git fix bytes indexing --- diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py index 93128563..3a2262d8 100644 --- a/Cython/Compiler/Optimize.py +++ b/Cython/Compiler/Optimize.py @@ -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, ],