Typing adjustments

This commit is contained in:
James R. Barlow
2022-07-23 00:07:50 -07:00
parent 014d0302f2
commit 9c8ddd853d
3 changed files with 5 additions and 3 deletions

View File

@@ -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 =

View File

@@ -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)

View File

@@ -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__)