Skip to content

Commit b31272c

Browse files
authored
Merge pull request #321 from sio2project/fix-corrupted-cache
Handle corrupted cache files caused by Ctrl-C
2 parents 3312c77 + ff08747 commit b31272c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/sinol_make/helpers/cache.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ def get_cache_file(solution_path: str) -> CacheFile:
2323
return CacheFile()
2424
try:
2525
return CacheFile.from_dict(data)
26+
except KeyError:
27+
print(util.warning(f"Cache file for program {os.path.basename(solution_path)} is corrupted. "
28+
f"Removing it, no action required."))
29+
os.unlink(cache_file_path)
30+
return CacheFile()
2631
except ValueError as exc:
2732
print(util.error(f"An error occured while parsing cache file for solution {os.path.basename(solution_path)}."))
2833
util.exit_with_error(str(exc))

0 commit comments

Comments
 (0)