From 26257b35a45e9bffef1668c573670089311d6caf Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Mon, 26 Apr 2010 08:38:24 +0200 Subject: [PATCH] fix bytes indexing --- Cython/Compiler/Optimize.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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, ], -- 2.26.2