From 3d9eb90d72af1102d4b65bd61a0370181c0b3172 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Fri, 20 Feb 2009 15:04:51 -0800 Subject: [PATCH] Fix refnanny for cpdef functions --- Cython/Compiler/Nodes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 43913284..71303535 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -2427,9 +2427,9 @@ class OverrideCheckNode(StatNode): else: code.putln("else if (unlikely(Py_TYPE(%s)->tp_dictoffset != 0)) {" % self_arg) err = code.error_goto_if_null(self.func_node.result(), self.pos) - code.put_gotref(self.func_node.py_result()) # need to get attribute manually--scope would return cdef method code.putln("%s = PyObject_GetAttr(%s, %s); %s" % (self.func_node.result(), self_arg, self.py_func.interned_attr_cname, err)) + code.put_gotref(self.func_node.py_result()) # It appears that this type is not anywhere exposed in the Python/C API is_builtin_function_or_method = '(strcmp(Py_TYPE(%s)->tp_name, "builtin_function_or_method") == 0)' % self.func_node.result() is_overridden = '(PyCFunction_GET_FUNCTION(%s) != (void *)&%s)' % (self.func_node.result(), self.py_func.entry.func_cname) -- 2.26.2