summaryrefslogtreecommitdiff
path: root/Cython/Utility/ModuleSetupCode.c
diff options
context:
space:
mode:
authorJeroen Demeyer <jdemeyer@cage.ugent.be>2018-02-15 11:06:32 +0100
committerJeroen Demeyer <jdemeyer@cage.ugent.be>2018-02-15 14:17:53 +0100
commita152462eba4463e4ab9292e76fb1a3e3b23aed64 (patch)
tree6a21ef5799065d27eb8f9d327d2d9823ccbb3b6a /Cython/Utility/ModuleSetupCode.c
parent969dbad1eac9c094a0beb4dc7b7868c288990ad6 (diff)
downloadcython-a152462eba4463e4ab9292e76fb1a3e3b23aed64.tar.gz
In Python 3, an unbound method is just the function
Diffstat (limited to 'Cython/Utility/ModuleSetupCode.c')
-rw-r--r--Cython/Utility/ModuleSetupCode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c
index 1661f40be..2aeabd2fe 100644
--- a/Cython/Utility/ModuleSetupCode.c
+++ b/Cython/Utility/ModuleSetupCode.c
@@ -617,7 +617,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
#endif
#if PY_MAJOR_VERSION >= 3
- #define __Pyx_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) : (Py_INCREF(func), func))
#else
#define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif