summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2015-04-11 17:56:13 +0200
committerStefan Behnel <stefan_ml@behnel.de>2015-04-11 17:56:13 +0200
commita3a4450650dc8f0fa06f742383775e1a2ef3506d (patch)
tree39fef9e8cd9d6f50cecedab4e2fc84e5716e6edd
parent4bfdc8da19476e572b269fa51960f167bb0007e6 (diff)
downloadcython-a3a4450650dc8f0fa06f742383775e1a2ef3506d.tar.gz
define PyUnicode_Contains() in PyPy if it's not available
-rw-r--r--Cython/Utility/ModuleSetupCode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c
index 495d2627e..1c5f91a85 100644
--- a/Cython/Utility/ModuleSetupCode.c
+++ b/Cython/Utility/ModuleSetupCode.c
@@ -105,6 +105,10 @@
#define __Pyx_PyFrozenSet_Size(s) PySet_Size(s)
#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))