From 94aa759a1e4717e9d7a5846b3f55fcc5745e488b Mon Sep 17 00:00:00 2001 From: Joshua Date: Sat, 23 Apr 2022 21:25:54 +0200 Subject: [PATCH] ufomerge.py: Fix handling of missing font path `ufo2._path` can be `None`, which makes `Path(ufo2._path)` fail. --- Lib/gftools/ufomerge.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Lib/gftools/ufomerge.py b/Lib/gftools/ufomerge.py index ff7064978..8b07f0e48 100644 --- a/Lib/gftools/ufomerge.py +++ b/Lib/gftools/ufomerge.py @@ -47,9 +47,8 @@ def merge_ufos( if layout_handling == "ignore": pass else: - includeDir = None - if hasattr(ufo2, "_path"): - includeDir = Path(ufo2._path).parent + path = getattr(ufo2, "_path", None) + includeDir = Path(ufo2._path).parent if path else None ff = FeaParser(ufo2.features.text, includeDir=includeDir).parse() for routine in ff.routines: newroutine = Routine(name=routine.name, flags=routine.flags)