From 0ad433c9639f9d318513008bbbaf04808b8a11ec Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 23 Jun 2019 13:31:07 +1000 Subject: [PATCH] Corrected error handling --- src/PIL/ImageFont.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PIL/ImageFont.py b/src/PIL/ImageFont.py index 7074a70c0..f43f95b9a 100644 --- a/src/PIL/ImageFont.py +++ b/src/PIL/ImageFont.py @@ -545,6 +545,8 @@ def truetype(font=None, size=10, index=0, encoding="", layout_engine=None): try: return freetype(font) except IOError: + if not isPath(font): + raise ttf_filename = os.path.basename(font) dirs = []