Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if not do_autohint:
continue
if output_path is not None:
hinted_otf_path = output_path
else:
hinted_otf_path = self._output_path(
ufo,
ext,
is_instance,
interpolatable,
autohinted=True,
output_dir=output_dir,
)
try:
ttfautohint(otf_path, hinted_otf_path, args=autohint)
except TTFAError:
# copy unhinted font to destination before re-raising error
shutil.copyfile(otf_path, hinted_otf_path)
raise
finally:
# must clean up temp file
os.remove(otf_path)