From 21279f5784cbe2be17f2f29843d070b636400502 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Thu, 28 Oct 2021 02:50:17 -0700 Subject: [PATCH] Fix leaked file handle for output_type none --- src/ocrmypdf/_sync.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ocrmypdf/_sync.py b/src/ocrmypdf/_sync.py index ea76dabb..e0da525e 100644 --- a/src/ocrmypdf/_sync.py +++ b/src/ocrmypdf/_sync.py @@ -290,10 +290,10 @@ def exec_concurrent(context: PdfContext, executor: Executor): # Copy text file to destination copy_final(text, options.sidecar, context) - if options.output_type != 'none': - # Merge layers to one single pdf - pdf = ocrgraft.finalize() + # Merge layers to one single pdf + pdf = ocrgraft.finalize() + if options.output_type != 'none': # PDF/A and metadata log.info("Postprocessing...") pdf = post_process(pdf, context, executor)