diff --git a/src/PIL/YaffFontFile.py b/src/PIL/YaffFontFile.py index 3be0db606..8ba530c97 100644 --- a/src/PIL/YaffFontFile.py +++ b/src/PIL/YaffFontFile.py @@ -182,7 +182,7 @@ def load( :raises SyntaxError: If the file is not a valid YAFF font. """ if hasattr(font, "read"): - data = font.read() # type: ignore[union-attr] + data = font.read() if isinstance(data, bytes): text = data.decode("utf-8-sig") else: