From c06bb8044d29e92f72c0ccd93b9892e346c7f4e5 Mon Sep 17 00:00:00 2001 From: nulano Date: Mon, 12 Oct 2020 01:26:53 +0100 Subject: [PATCH] remove PyPy3-7.1.x compatibility code --- Tests/test_imagefont.py | 2 -- src/_imagingft.c | 22 ---------------------- 2 files changed, 24 deletions(-) diff --git a/Tests/test_imagefont.py b/Tests/test_imagefont.py index e47cb05c1..ccff01931 100644 --- a/Tests/test_imagefont.py +++ b/Tests/test_imagefont.py @@ -15,7 +15,6 @@ from .helper import ( assert_image_equal_tofile, assert_image_similar, assert_image_similar_tofile, - is_pypy, is_win32, skip_unless_feature, ) @@ -474,7 +473,6 @@ class TestImageFont: with pytest.raises(UnicodeEncodeError): font.getsize("’") - @pytest.mark.xfail(is_pypy(), reason="failing on PyPy with Raqm") def test_unicode_extended(self): # issue #3777 text = "A\u278A\U0001F12B" diff --git a/src/_imagingft.c b/src/_imagingft.c index 2435fbab4..63e23a0df 100644 --- a/src/_imagingft.c +++ b/src/_imagingft.c @@ -364,27 +364,6 @@ text_layout_raqm(PyObject* string, FontObject* self, const char* dir, PyObject * goto failed; } -#if (defined(PYPY_VERSION_NUM) && (PYPY_VERSION_NUM < 0x07020000)) - if (PyUnicode_Check(string)) { - Py_UNICODE *text = PyUnicode_AS_UNICODE(string); - Py_ssize_t size = PyUnicode_GET_SIZE(string); - if (! size) { - /* return 0 and clean up, no glyphs==no size, - and raqm fails with empty strings */ - goto failed; - } - if (!(*p_raqm.set_text)(rq, (const uint32_t *)(text), size)) { - PyErr_SetString(PyExc_ValueError, "raqm_set_text() failed"); - goto failed; - } - if (lang) { - if (!(*p_raqm.set_language)(rq, lang, start, size)) { - PyErr_SetString(PyExc_ValueError, "raqm_set_language() failed"); - goto failed; - } - } - } -#else if (PyUnicode_Check(string)) { Py_UCS4 *text = PyUnicode_AsUCS4Copy(string); Py_ssize_t size = PyUnicode_GET_LENGTH(string); @@ -406,7 +385,6 @@ text_layout_raqm(PyObject* string, FontObject* self, const char* dir, PyObject * } } } -#endif else { PyErr_SetString(PyExc_TypeError, "expected string"); goto failed;