Make manage_cache backwards compatible.
- Old caches don't have checksum files.
This commit is contained in:
parent
321ed11ffe
commit
7abf025671
1 changed files with 5 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue