From 53fb75dffad6bbf918c568d7bb0e87af22503592 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Mon, 22 Apr 2019 17:51:09 -0600 Subject: BUG: Some PyPy versions lack PyStructSequence_InitType2. Define `PyStructSequence_InitType2` for those PyPy versions that don't support it. Closes gh-13384. --- numpy/core/src/multiarray/typeinfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'numpy/core/src') diff --git a/numpy/core/src/multiarray/typeinfo.c b/numpy/core/src/multiarray/typeinfo.c index bc4147841..14c4f27cb 100644 --- a/numpy/core/src/multiarray/typeinfo.c +++ b/numpy/core/src/multiarray/typeinfo.c @@ -104,8 +104,10 @@ PyArray_typeinforanged( return entry; } -/* Backport, only needed here */ -#if PY_VERSION_HEX < 0x03040000 +/* Python version only needed for backport to 2.7 */ +#if (PY_VERSION_HEX < 0x03040000) \ + || (defined(PYPY_VERSION_NUM) && (PYPY_VERSION_NUM < 0x07020000)) + static int PyStructSequence_InitType2(PyTypeObject *type, PyStructSequence_Desc *desc) { PyStructSequence_InitType(type, desc); -- cgit v1.2.1