Skip to content

Commit

Permalink
ufomerge.py: Fix handling of missing font path
Browse files Browse the repository at this point in the history
`ufo2._path` can be `None`, which makes `Path(ufo2._path)` fail.
  • Loading branch information
joshuakraemer committed Apr 27, 2022
1 parent 9ff6932 commit 94aa759
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Lib/gftools/ufomerge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 94aa759

Please sign in to comment.