Skip to content

Commit

Permalink
BUG: Some PyPy versions lack PyStructSequence_InitType2.
Browse files Browse the repository at this point in the history
Define `PyStructSequence_InitType2` for those PyPy versions that
don't support it.

Closes numpygh-13384.
  • Loading branch information
charris committed Apr 22, 2019
1 parent 2b59dcb commit 53fb75d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions numpy/core/src/multiarray/typeinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 53fb75d

Please sign in to comment.