applied fix by haoyu for bug #543
authorStefan Behnel <scoder@users.berlios.de>
Sat, 17 Jul 2010 17:28:14 +0000 (19:28 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 17 Jul 2010 17:28:14 +0000 (19:28 +0200)
Cython/Compiler/ModuleNode.py

index 21a6fbdf3348014e8f58498e45359d7d7348500b..143ccbfbbc02c6e913fbf5ad5187881a84893e17 100644 (file)
@@ -583,7 +583,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
 
         code.put("""
 #if PY_MAJOR_VERSION >= 3
-  #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
+  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
 #endif
 
 #if PY_VERSION_HEX < 0x02050000