summaryrefslogtreecommitdiffstats
path: root/util/cmake/condition_simplifier_cache.py
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@qt.io>2019-10-07 12:22:04 +0200
committerFrederik Gladhorn <frederik.gladhorn@qt.io>2019-10-09 09:13:44 +0000
commit3a103b360802b81318a20063f2b4884864e79b15 (patch)
tree72ecccedf25f87190e4fccabeda372b8d5886e8a /util/cmake/condition_simplifier_cache.py
parentd1542e8a73f535011d42970cc5b1b28a414c14c9 (diff)
cmake scripts: fix type issues
Some of the changes are just cosmetic, but a bunch of them must be bugs, such as mixing lists and str randomly. Change-Id: Idd8340e17bcea7af3b87e595e251e13f5df1aa3f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'util/cmake/condition_simplifier_cache.py')
-rw-r--r--util/cmake/condition_simplifier_cache.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/cmake/condition_simplifier_cache.py b/util/cmake/condition_simplifier_cache.py
index d1efff1d87..947b18af81 100644
--- a/util/cmake/condition_simplifier_cache.py
+++ b/util/cmake/condition_simplifier_cache.py
@@ -35,7 +35,7 @@ import os
import sys
import time
-from typing import Callable
+from typing import Any, Callable, Dict, Union
condition_simplifier_cache_enabled = True
@@ -66,7 +66,7 @@ def get_file_checksum(file_path: str) -> str:
with open(file_path, "r") as content_file:
content = content_file.read()
except IOError:
- content = time.time()
+ content = str(time.time())
checksum = hashlib.md5(content.encode("utf-8")).hexdigest()
return checksum
@@ -88,7 +88,7 @@ def init_cache_dict():
def simplify_condition_memoize(f: Callable[[str], str]):
cache_path = get_cache_location()
- cache_file_content = None
+ cache_file_content: Dict[str, Any] = {}
if os.path.exists(cache_path):
try: