From ca3ad49de3337725992033f8430f3261c67e94d0 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 27 Apr 2021 08:12:45 +1000 Subject: [PATCH] Fixed bug when checking FreeType2 version if it is not installed --- src/PIL/ImageFont.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PIL/ImageFont.py b/src/PIL/ImageFont.py index 2f63ddae6..e99ca21b2 100644 --- a/src/PIL/ImageFont.py +++ b/src/PIL/ImageFont.py @@ -170,8 +170,10 @@ class FreeTypeFont: except ImportError: pass else: - freetype_version = parse_version(features.version_module("freetype2")) - if freetype_version < parse_version("2.8"): + freetype_version = features.version_module("freetype2") + if freetype_version is not None and parse_version( + freetype_version + ) < parse_version("2.8"): warnings.warn( "Support for FreeType 2.7 is deprecated and will be removed" " in Pillow 9 (2022-01-02). Please upgrade to FreeType 2.8 "