ghostscript: don't delete output_file that will never exist

We stream output now, so no point in deleting.
This commit is contained in:
James R. Barlow 2019-12-30 22:38:38 -08:00
parent c4dc5269d2
commit 16dd8b54a8

View File

@ -195,8 +195,6 @@ def rasterize_pdf(
try:
p = run(args_gs, stdout=PIPE, stderr=PIPE, check=True)
except CalledProcessError as e:
with suppress(OSError):
Path(output_file).unlink() # no unfinished files
log.error(e.stderr.decode(errors='replace'))
raise SubprocessOutputError('Ghostscript rasterizing failed')
else:
@ -320,8 +318,6 @@ def generate_pdfa(
except CalledProcessError as e:
# Ghostscript does not change return code when it fails to create
# PDF/A - check PDF/A status elsewhere
with suppress(OSError):
Path(output_file).unlink()
log.error(e.stderr.decode(errors='replace'))
raise SubprocessOutputError('Ghostscript PDF/A rendering failed')
else: