mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 10:46:16 +03:00
Use os.fspath instead of isinstance and str
This commit is contained in:
parent
16d4068b42
commit
d631afc266
|
@ -230,8 +230,7 @@ class FreeTypeFont:
|
|||
)
|
||||
|
||||
if is_path(font):
|
||||
if isinstance(font, os.PathLike):
|
||||
font = str(font)
|
||||
font = os.fspath(font)
|
||||
if sys.platform == "win32":
|
||||
font_bytes_path = font if isinstance(font, bytes) else font.encode()
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue
Block a user