From b8109c6462343f06561ba52f767f389edc204a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Mon, 23 Aug 2021 14:20:26 +0200 Subject: [PATCH] fix: Make mypy happy --- lookyloo/lookyloo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lookyloo/lookyloo.py b/lookyloo/lookyloo.py index 10fbf43..892c470 100644 --- a/lookyloo/lookyloo.py +++ b/lookyloo/lookyloo.py @@ -619,12 +619,13 @@ class Lookyloo(): def _get_capture_dir(self, capture_uuid: str, /) -> Path: '''Use the cache to get a capture directory from a capture UUID''' + capture_dir: Optional[Union[str, Path]] if capture_uuid in self._captures_index: capture_dir = self._captures_index[capture_uuid].capture_dir if capture_dir.exists(): return capture_dir self._captures_index.pop(capture_uuid) - capture_dir: str = self.redis.hget('lookup_dirs', capture_uuid) + capture_dir = self.redis.hget('lookup_dirs', capture_uuid) if capture_dir and not Path(capture_dir).exists(): # The capture was either removed or archived, cleaning up self.redis.hdel('lookup_dirs', capture_uuid)