chg: make mypy happy

pull/298/head
Raphaël Vinot 2021-11-30 15:23:48 +01:00
parent 8f4040b806
commit 5e33ad6d0b
2 changed files with 4 additions and 4 deletions

View File

@ -753,7 +753,7 @@ class Lookyloo():
with hashlookup_file.open() as f:
hashlookup_entries = json.load(f)
to_return = defaultdict(dict)
to_return: Dict[str, Dict[str, Any]] = defaultdict(dict)
for sha1 in hashlookup_entries.keys():
to_return[sha1]['nodes'] = hashes_tree[sha1]

View File

@ -57,8 +57,8 @@ class HashlookupModule():
if not self.available:
raise ConfigError('Hashlookup not available, probably not enabled.')
to_return = {}
to_return: Dict[str, Dict[str, str]] = {}
for entry in self.client.sha1_bulk_lookup(hashes):
if 'SHA-1' in entry:
to_return[entry['SHA-1'].lower()] = entry
if 'SHA-1' in entry and isinstance(entry['SHA-1'], str):
to_return[entry['SHA-1'].lower()] = entry # type: ignore
return to_return