From: Stefan Behnel Date: Thu, 15 May 2008 07:38:35 +0000 (+0200) Subject: fixed PyMethod_New() call X-Git-Tag: 0.9.8rc1~37^2~64 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e922fc0db14f41f66ef7ee3a9b9e7840966bd929;p=cython.git fixed PyMethod_New() call --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index d659c9c9..cbcd2586 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -2470,7 +2470,7 @@ class UnboundMethodNode(ExprNode): def generate_result_code(self, code): code.putln( - "%s = PyMethod_New(%s, 0, %s); %s" % ( + "%s = __Pyx_PyMethod_New(%s, 0, %s); %s" % ( self.result_code, self.function.py_result(), self.class_cname, diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 7c4fff71..db0122d3 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -415,8 +415,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code.putln("#endif") code.putln("#if PY_MAJOR_VERSION >= 3") - code.putln(" #define PyMethod_New(func, self, klass) (func!=NULL?(Py_INCREF(func),func):NULL)") - code.putln(" #define PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)") + code.putln(" #define PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)") + code.putln(" #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, klass)") + code.putln("#else") + code.putln(" #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)") code.putln("#endif") code.putln("#ifndef __stdcall")