error(self.pos,
"Invalid index type '%s'" %
self.index.type)
+ self.gil_check(env)
+ def gil_check(self, env):
+ if not self.is_buffer_access:
+ if self.base.type.is_pyobject:
+ self._gil_check(env)
+
gil_message = "Indexing Python object"
+ def gil_check(self, env):
+ if self.is_buffer_access and env.nogil:
+ if env.directives['boundscheck']:
+ error(self.pos, "Cannot check buffer index bounds without gil; use boundscheck(False) directive")
+ return
+ elif self.type.is_pyobject:
+ error(self.pos, "Cannot access buffer with object dtype without gil")
+ return
+ super(IndexNode, self).gil_check(env)
+
+
def check_const_addr(self):
self.base.check_const_addr()
self.index.check_const()
code.globalstate.use_utility_code(refcount_utility_code)
- code.putln('const char *%s = "%s";' % (Naming.modulename_cname, self.full_module_name))
+ code.putln('#define __Pyx_MODULE_NAME "%s"' % self.full_module_name)
code.putln("")
code.putln("/* Implementation of %s */" % env.qualified_name)
- self.generate_const_definitions(env, code)
- self.generate_interned_num_decls(env, code)
- self.generate_interned_string_decls(env, code)
- self.generate_py_string_decls(env, code)
code.globalstate.insert_global_var_declarations_into(code)
-
+
self.generate_cached_builtins_decls(env, code)
self.body.generate_function_definitions(env, code)
code.mark_pos(None)