From 7abf02567155694121ae140c1b946d4f340f2056 Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Thu, 16 Dec 2021 00:41:22 +1000 Subject: [PATCH] Make manage_cache backwards compatible. - Old caches don't have checksum files. --- eris/eris/__main__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eris/eris/__main__.py b/eris/eris/__main__.py index 1740345..741e61f 100755 --- a/eris/eris/__main__.py +++ b/eris/eris/__main__.py @@ -1090,8 +1090,11 @@ def manage_cache(root_path): cache_path = os.path.join(root_path, tools.CACHE_PATH) checksum_path = os.path.join(cache_path, "source_checksum") if os.path.exists(cache_path): - with open(checksum_path, "r") as checksum_file: - cache_checksum = checksum_file.read() + try: + with open(checksum_path, "r") as checksum_file: + cache_checksum = checksum_file.read() + except FileNotFoundError: + cache_checksum = None if source_checksum() != cache_checksum: print("Eris has changed, recalculating all results…") shutil.rmtree(cache_path)