summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2020-07-09 17:36:57 +0200
committerStefan Behnel <stefan_ml@behnel.de>2020-07-09 17:36:57 +0200
commit8f445d7d66961bd8740ee8fd39aa066ac00ef758 (patch)
treef4f3a403dce6bac97ac6e0115743a1d70f7db914
parent8830bf2b102996e3dda97e83fc3ef4efe368bdc6 (diff)
downloadcython-8f445d7d66961bd8740ee8fd39aa066ac00ef758.tar.gz
PyPy does not support PyType_GetSlot(). Use type slots instead.
-rw-r--r--Cython/Utility/ExtensionTypes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Cython/Utility/ExtensionTypes.c b/Cython/Utility/ExtensionTypes.c
index 82a68c5d1..4220df84c 100644
--- a/Cython/Utility/ExtensionTypes.c
+++ b/Cython/Utility/ExtensionTypes.c
@@ -343,7 +343,7 @@ __PYX_GOOD:
static CYTHON_INLINE PyObject *{{func_name}}_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right {{extra_arg_decl}}) {
{{slot_type}} slot;
-#if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3
+#if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
slot = type->tp_as_number ? type->tp_as_number->{{slot_name}} : NULL;
#else
slot = ({{slot_type}}) PyType_GetSlot(type, Py_{{slot_name}});