From 162a47f98ee4f5b08e86880d7f1b48eee6be51bb Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Tue, 19 Sep 2023 14:44:14 -0700 Subject: [PATCH] Drop reportlab warning shim --- src/ocrmypdf/hocrtransform.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/ocrmypdf/hocrtransform.py b/src/ocrmypdf/hocrtransform.py index 0380d90f..40f59949 100755 --- a/src/ocrmypdf/hocrtransform.py +++ b/src/ocrmypdf/hocrtransform.py @@ -11,20 +11,14 @@ from __future__ import annotations import argparse import os import re -import warnings from math import atan, cos, sin from pathlib import Path from typing import Any, NamedTuple from xml.etree import ElementTree -with warnings.catch_warnings(): - # reportlab uses deprecated load_module - warnings.filterwarnings( - 'ignore', category=DeprecationWarning, message=r".*load_module.*" - ) - from reportlab.lib.colors import black, cyan, magenta, red - from reportlab.lib.units import inch - from reportlab.pdfgen.canvas import Canvas +from reportlab.lib.colors import black, cyan, magenta, red +from reportlab.lib.units import inch +from reportlab.pdfgen.canvas import Canvas # According to Wikipedia these languages are supported in the ISO-8859-1 character # set, meaning reportlab can generate them and they are compatible with hocr,