From 53db866ef96f98e442421f65e1662bb244047240 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Thu, 4 Aug 2022 03:54:55 -0700 Subject: [PATCH] Remove deprecated exception PdfMergeFailedError --- src/ocrmypdf/__init__.py | 1 - src/ocrmypdf/api.py | 2 -- src/ocrmypdf/exceptions.py | 20 -------------------- 3 files changed, 23 deletions(-) diff --git a/src/ocrmypdf/__init__.py b/src/ocrmypdf/__init__.py index 7f4a4cd2..25c3039d 100644 --- a/src/ocrmypdf/__init__.py +++ b/src/ocrmypdf/__init__.py @@ -21,7 +21,6 @@ from ocrmypdf.exceptions import ( InputFileError, MissingDependencyError, OutputFileAccessError, - PdfMergeFailedError, PriorOcrFoundError, SubprocessOutputError, TesseractConfigError, diff --git a/src/ocrmypdf/api.py b/src/ocrmypdf/api.py index 8d92eb71..67febaeb 100644 --- a/src/ocrmypdf/api.py +++ b/src/ocrmypdf/api.py @@ -284,8 +284,6 @@ def ocr( # pylint: disable=unused-argument ``"-"``, some final validation steps are not performed (we do not read back the stream after it is written). Raises: - ocrmypdf.PdfMergeFailedError: If the input PDF is malformed, preventing merging - with the OCR layer. ocrmypdf.MissingDependencyError: If a required dependency program is missing or was not found on PATH. ocrmypdf.UnsupportedImageFormatError: If the input file type was an image that diff --git a/src/ocrmypdf/exceptions.py b/src/ocrmypdf/exceptions.py index d5a9ae8e..b56e8a1a 100644 --- a/src/ocrmypdf/exceptions.py +++ b/src/ocrmypdf/exceptions.py @@ -47,26 +47,6 @@ class BadArgsError(ExitCodeException): exit_code = ExitCode.bad_args -class PdfMergeFailedError(ExitCodeException): # deprecated - """An intermediate PDF can't be merged. - - No longer in use. - """ - - exit_code = ExitCode.input_file - message = dedent( - '''\ - Failed to merge PDF image layer with OCR layer - - Usually this happens because the input PDF file is malformed and - ocrmypdf cannot correct the problem on its own. - - Try using - ocrmypdf --pdf-renderer sandwich [..other args..] - ''' - ) - - class MissingDependencyError(ExitCodeException): """A third-party dependency is missing."""