mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2025-12-28 07:30:04 +00:00
ghostscript: don't delete output_file that will never exist
We stream output now, so no point in deleting.
This commit is contained in:
parent
c4dc5269d2
commit
16dd8b54a8
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user