diff --git a/setup.cfg b/setup.cfg index 894488e3..69f4ab41 100644 --- a/setup.cfg +++ b/setup.cfg @@ -86,8 +86,8 @@ test = pytest-cov>=2.11.1 pytest-xdist>=2.2.0 python-xmp-toolkit==2.0.1 # also requires apt-get install libexempi3 - types-humanfriendly types-Pillow + types-humanfriendly watcher = watchdog>=1.0.2 webservice = diff --git a/src/ocrmypdf/_pipeline.py b/src/ocrmypdf/_pipeline.py index af7e6f9d..7e545adf 100644 --- a/src/ocrmypdf/_pipeline.py +++ b/src/ocrmypdf/_pipeline.py @@ -494,7 +494,7 @@ def preprocess_deskew(input_file: Path, page_context: PageContext): deskewed = im.rotate( deskew_angle_degrees, resample=BICUBIC, - fillcolor=ImageColor.getcolor('white', mode=im.mode), + fillcolor=ImageColor.getcolor('white', mode=im.mode), # type: ignore ) deskewed.save(output_file, dpi=dpi) diff --git a/src/ocrmypdf/subprocess/_windows.py b/src/ocrmypdf/subprocess/_windows.py index c610c35c..705926f4 100644 --- a/src/ocrmypdf/subprocess/_windows.py +++ b/src/ocrmypdf/subprocess/_windows.py @@ -20,7 +20,9 @@ from typing import Any, Callable, Iterable, Iterator, Set, Tuple, TypeVar try: import winreg except ModuleNotFoundError as _notfound_ex: - raise ModuleNotFoundError("This module is for Windows only") from _notfound_ex + from unittest import mock + + winreg = mock.MagicMock() log = logging.getLogger(__name__)