From a63a21a7fcbb8043339b479d67509c1dd7882502 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Thu, 28 Oct 2021 02:46:34 -0700 Subject: [PATCH] helpers: remove shim for unsupported old version of pikepdf --- src/ocrmypdf/helpers.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/ocrmypdf/helpers.py b/src/ocrmypdf/helpers.py index 7ff2ea71..fce36a8f 100644 --- a/src/ocrmypdf/helpers.py +++ b/src/ocrmypdf/helpers.py @@ -221,15 +221,7 @@ def check_pdf(input_file: Path) -> bool: # If linearization is missing entirely, we do not complain. We do # complain if linearization is present but incorrect. pdf.check_linearization(sio) - except RuntimeError: - pass - except ( - # Workaround for a problematic pikepdf version - # pragma: no cover - pikepdf.ForeignObjectError - if pikepdf.__version__ == '2.1.0' - else NeverRaise - ): + except (RuntimeError, pikepdf.ForeignObjectError): pass else: linearize_msgs = sio.getvalue()