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];