Commit e922fc0d authored by Stefan Behnel's avatar Stefan Behnel

fixed PyMethod_New() call

parent 22b3567a
...@@ -2470,7 +2470,7 @@ class UnboundMethodNode(ExprNode): ...@@ -2470,7 +2470,7 @@ class UnboundMethodNode(ExprNode):
def generate_result_code(self, code): def generate_result_code(self, code):
code.putln( code.putln(
"%s = PyMethod_New(%s, 0, %s); %s" % ( "%s = __Pyx_PyMethod_New(%s, 0, %s); %s" % (
self.result_code, self.result_code,
self.function.py_result(), self.function.py_result(),
self.class_cname, self.class_cname,
......
...@@ -415,8 +415,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -415,8 +415,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln("#endif") code.putln("#endif")
code.putln("#if PY_MAJOR_VERSION >= 3") 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("#endif")
code.putln("#ifndef __stdcall") code.putln("#ifndef __stdcall")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment