Skip to content

Commit

Permalink
Convert With TryExcept (needs a windowcontroll) to a plain try and ex…
Browse files Browse the repository at this point in the history
…cept
  • Loading branch information
typemytype committed Dec 15, 2023
1 parent 1cf8b64 commit 7a59dc2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion DesignspaceEditor2.roboFontExt/lib/designspaceEditor/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def okCallback(self, sender):

for item in self.instances:
instanceDescriptor = item["object"]
with TryExcept(self, "Generate Instance"):
try:
font = self.operator.makeInstance(instanceDescriptor)
if not os.path.exists(os.path.dirname(instanceDescriptor.path)):
os.makedirs(os.path.dirname(instanceDescriptor.path))
Expand All @@ -292,6 +292,8 @@ def okCallback(self, sender):
fontPath = f"{fileName}-{('mm', 'varLib')[mathModel]}{ext}"

font.save(path=fontPath)
except Exception as e:
print(f"Failed to generate isntance: {e}")

self.operator.useVarlib = prereserveuseVarlib
self.operator.roundGeometry = prereserveRoundGeometry
Expand Down

0 comments on commit 7a59dc2

Please sign in to comment.