From aa52a5c91c1d7f0dc6691fdd972e343fc63f6fc2 Mon Sep 17 00:00:00 2001
From: jvoisin <julien.voisin@dustri.org>
Date: Tue, 14 May 2019 00:46:48 +0200
Subject: [PATCH] Please mypy wrt. the last two commits

---
 libmat2/__init__.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libmat2/__init__.py b/libmat2/__init__.py
index 501baaa..ff899ff 100644
--- a/libmat2/__init__.py
+++ b/libmat2/__init__.py
@@ -1,15 +1,15 @@
 #!/usr/bin/env python3
 
-import collections
 import enum
 import importlib
-from typing import Dict, Optional
+from typing import Dict, Optional, Union
 
 from . import exiftool, video
 
 # make pyflakes happy
 assert Dict
 assert Optional
+assert Union
 
 # A set of extension that aren't supported, despite matching a supported mimetype
 UNSUPPORTED_EXTENSIONS = {
@@ -68,7 +68,7 @@ CMD_DEPENDENCIES = {
 }
 
 def check_dependencies() -> Dict[str, Dict[str, bool]]:
-    ret = collections.defaultdict(bool)  # type: Dict[str, bool]
+    ret = dict()  # type: Dict[str, dict]
 
     for key, value in DEPENDENCIES.items():
         ret[key] = {
@@ -76,7 +76,7 @@ def check_dependencies() -> Dict[str, Dict[str, bool]]:
             'required': value['required'],
         }
         try:
-            importlib.import_module(value['module'])
+            importlib.import_module(value['module'])  # type: ignore
         except ImportError:  # pragma: no cover
             ret[key]['found'] = False
 
@@ -86,7 +86,7 @@ def check_dependencies() -> Dict[str, Dict[str, bool]]:
             'required': v['required'],
         }
         try:
-            v['cmd']()
+            v['cmd']()  # type: ignore
         except RuntimeError:  # pragma: no cover
             ret[k]['found'] = False
 
-- 
GitLab