Update of src/PIL/YaffFontFile.py as per suggested

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
Endre Szabo 2026-04-29 11:22:45 +02:00 committed by GitHub
parent 869e5874d8
commit de223d88e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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: