nogil = cfunc_type.nogil,
visibility = 'private',
api = False,
- directive_locals = cfunc.directive_locals)
+ directive_locals = getattr(cfunc, 'directive_locals', {}))
def analyse_declarations(self, env):
if 'locals' in env.directives:
def visit_DefNode(self, node):
pxd_def = self.scope.lookup(node.name)
if pxd_def:
+ if self.scope.is_c_class_scope and len(pxd_def.type.args) > 0:
+ # The self parameter type needs adjusting.
+ pxd_def.type.args[0].type = self.scope.parent_type
if pxd_def.is_cfunction:
node = node.as_cfunction(pxd_def)
else: