Replaced IOError with OSError

This commit is contained in:
Andrew Murray 2022-11-05 15:41:17 +11:00
parent 1c57ab8429
commit 51d95add6a
3 changed files with 3 additions and 3 deletions

View File

@ -59,6 +59,6 @@ def test_fuzz_fonts(path):
fuzzers.fuzz_font(f.read())
except (Image.DecompressionBombError,
Image.DecompressionBombWarning,
IOError):
OSError):
pass
assert True

View File

@ -17,6 +17,6 @@ class TestFontCrash:
@skip_unless_feature("freetype2")
def test_segfault(self):
with pytest.raises(IOError):
with pytest.raises(OSError):
font = ImageFont.truetype("Tests/fonts/fuzz_font-5203009437302784")
self._fuzz_font(font)

View File

@ -923,7 +923,7 @@ font_render(FontObject *self, PyObject *args) {
// Null buffer, is dereferenced in FT_Bitmap_Convert
if (!bitmap.buffer && bitmap.rows) {
PyErr_SetString(PyExc_IOError, "Bitmap missing for glyph");
PyErr_SetString(PyExc_OSError, "Bitmap missing for glyph");
goto glyph_error;
}