From 2ba38dd2a18ab57ed7aac7ccdd6a42ff5e4d4eb7 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Fri, 12 Oct 2018 11:58:01 +0200 Subject: Bump mypy typing coverage --- libmat2/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libmat2/__init__.py') diff --git a/libmat2/__init__.py b/libmat2/__init__.py index fbb61bc..f55a14c 100644 --- a/libmat2/__init__.py +++ b/libmat2/__init__.py @@ -8,6 +8,7 @@ from typing import Dict, Optional # make pyflakes happy assert Dict +assert Optional # A set of extension that aren't supported, despite matching a supported mimetype UNSUPPORTED_EXTENSIONS = { @@ -36,7 +37,7 @@ DEPENDENCIES = { 'mutagen': 'Mutagen', } -def _get_exiftool_path() -> Optional[str]: # pragma: no cover +def _get_exiftool_path() -> str: # pragma: no cover exiftool_path = '/usr/bin/exiftool' if os.path.isfile(exiftool_path): if os.access(exiftool_path, os.X_OK): @@ -48,7 +49,7 @@ def _get_exiftool_path() -> Optional[str]: # pragma: no cover if os.access(exiftool_path, os.X_OK): return exiftool_path - return None + raise ValueError def check_dependencies() -> dict: ret = collections.defaultdict(bool) # type: Dict[str, bool] -- cgit v1.3