summaryrefslogtreecommitdiff
path: root/Cython/Utility/ModuleSetupCode.c
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2014-10-08 21:00:26 +0200
committerStefan Behnel <stefan_ml@behnel.de>2014-10-08 21:00:26 +0200
commit55d87d498ef281f1a5e66c3d2c07f2e09f0cbcef (patch)
tree9f6f25a8f14b7a491f3313a01facef683bf55711 /Cython/Utility/ModuleSetupCode.c
parent6b21b89a4f08065cad97ed2a2d605c63ce3e866d (diff)
downloadcython-55d87d498ef281f1a5e66c3d2c07f2e09f0cbcef.tar.gz
fix PyMethod_New() in pypy3
Diffstat (limited to 'Cython/Utility/ModuleSetupCode.c')
-rw-r--r--Cython/Utility/ModuleSetupCode.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c
index a0741fde6..51bb02969 100644
--- a/Cython/Utility/ModuleSetupCode.c
+++ b/Cython/Utility/ModuleSetupCode.c
@@ -168,7 +168,13 @@
#endif
#if PY_MAJOR_VERSION >= 3
- #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+ #ifndef PyMethod_New
+ /* for backwards compatibility only, but PyPy redefines PyMethod_New unconditionally */
+ #define PyMethod_New(func, self, klass) __Pyx_PyMethod_New(func, self, klass)
+ #endif
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
/* inline attribute */