diff --git a/vimiv/utils/imageheader.py b/vimiv/utils/imageheader.py index db6bc3f7..2d749f0a 100644 --- a/vimiv/utils/imageheader.py +++ b/vimiv/utils/imageheader.py @@ -53,7 +53,7 @@ import functools -from typing import Optional, List, Callable, Tuple, BinaryIO +from typing import Optional, List, Callable, Tuple, BinaryIO, cast from vimiv.qt.gui import QImageReader @@ -127,7 +127,8 @@ def check_verified(header: bytes, file: BinaryIO) -> bool: _registry.remove((filetype, check_verified)) return False - check_register = check_verified if validate else check + # See: https://github.com/python/mypy/issues/12056 + check_register = cast(CheckFuncT, check_verified if validate else check) if priority: _registry.insert(0, (filetype, check_register))