Commit e16c4bc1 authored by scoder's avatar scoder Committed by GitHub

Merge pull request #2554 from akruis/add_stackless_meth_flag

make the fast-call signature test compatible with Stackless Python
parents 037bcf03 190c9c87
...@@ -388,6 +388,11 @@ class __Pyx_FakeReference { ...@@ -388,6 +388,11 @@ class __Pyx_FakeReference {
#define Py_TPFLAGS_HAVE_FINALIZE 0 #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif #endif
#ifndef METH_STACKLESS
// already defined for Stackless Python (all versions) and C-Python >= 3.7
// value if defined: Stackless Python < 3.6: 0x80 else 0x100
#define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
// new in CPython 3.6, but changed in 3.7 - see // new in CPython 3.6, but changed in 3.7 - see
// positional-only parameters: // positional-only parameters:
...@@ -407,7 +412,7 @@ class __Pyx_FakeReference { ...@@ -407,7 +412,7 @@ class __Pyx_FakeReference {
#endif #endif
#if CYTHON_FAST_PYCCALL #if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func) \ #define __Pyx_PyFastCFunction_Check(func) \
((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else #else
#define __Pyx_PyFastCFunction_Check(func) 0 #define __Pyx_PyFastCFunction_Check(func) 0
#endif #endif
......
...@@ -1557,7 +1557,7 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { ...@@ -1557,7 +1557,7 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
{ {
PyMethodDescrObject *descr = (PyMethodDescrObject*) method; PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
target->func = descr->d_method->ml_meth; target->func = descr->d_method->ml_meth;
target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST); target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
} }
#endif #endif
return 0; return 0;
...@@ -2144,7 +2144,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, P ...@@ -2144,7 +2144,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, P
int flags = PyCFunction_GET_FLAGS(func); int flags = PyCFunction_GET_FLAGS(func);
assert(PyCFunction_Check(func)); assert(PyCFunction_Check(func));
assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))); assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
assert(nargs >= 0); assert(nargs >= 0);
assert(nargs == 0 || args != NULL); assert(nargs == 0 || args != NULL);
......
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