From 5117211328075a598ac7691b8ff0748657c3c496 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Wed, 21 Apr 2021 17:58:55 +0200 Subject: [PATCH] Don't generate wheels unusable on PyPy7.3.{0,1}. --- src/ft2font_wrapper.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ft2font_wrapper.cpp b/src/ft2font_wrapper.cpp index 24330a810545..362df3a2d3aa 100644 --- a/src/ft2font_wrapper.cpp +++ b/src/ft2font_wrapper.cpp @@ -544,7 +544,10 @@ static PyObject *PyFT2Font_set_text(PyFT2Font *self, PyObject *args, PyObject *k if (PyUnicode_Check(textobj)) { size = PyUnicode_GET_LENGTH(textobj); codepoints.resize(size); -#if defined(PYPY_VERSION) && (PYPY_VERSION_NUM < 0x07030200) +#if defined(PYPY_VERSION) && (PYPY_VERSION_NUM < 0x07040000) + // PyUnicode_ReadChar is available from PyPy 7.3.2, but wheels do not + // specify the micro-release version, so put the version bound at 7.4 + // to prevent generating wheels unusable on PyPy 7.3.{0,1}. Py_UNICODE *unistr = PyUnicode_AsUnicode(textobj); for (size_t i = 0; i < size; ++i) { codepoints[i] = unistr[i];