diff --git a/ocrmypdf/pipeline.py b/ocrmypdf/pipeline.py index f20aac3e..6e0a4503 100644 --- a/ocrmypdf/pipeline.py +++ b/ocrmypdf/pipeline.py @@ -18,7 +18,8 @@ from .pdfinfo import PdfInfo, Encoding, Colorspace from .pdfa import generate_pdfa_ps from .helpers import re_symlink, is_iterable_notstr, page_number from .exec import ghostscript, tesseract, qpdf -from .exceptions import * +from .exceptions import PdfMergeFailedError, UnsupportedImageFormatError, \ + DpiError, PriorOcrFoundError, InputFileError from . import leptonica from . import PROGRAM_NAME, VERSION @@ -160,7 +161,7 @@ def _pdf_guess_version(input_file, search_window=1024): with open(input_file, 'rb') as f: signature = f.read(1024) - m = re.search(b'%PDF-(\d\.\d)', signature) + m = re.search(br'%PDF-(\d\.\d)', signature) if m: return m.group(1) return '' @@ -1240,7 +1241,7 @@ def build_pipeline(options, work_folder, log, context): task_merge_sidecars.active_if(options.sidecar) # Finalize - task_copy_final = main_pipeline.merge( + main_pipeline.merge( task_func=copy_final, input=[task_merge_pages_ghostscript, task_merge_pages_qpdf], output=options.output_file, diff --git a/tests/test_main.py b/tests/test_main.py index 8a9b921d..f569c94a 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -17,6 +17,9 @@ from math import isclose import PIL +# pytest.helpers is dynamic +# pylint: disable=no-member +# pylint: disable=w0612 check_ocrmypdf = pytest.helpers.check_ocrmypdf run_ocrmypdf = pytest.helpers.run_ocrmypdf