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 "