Mercurial > vim-crosoft
changeset 8:d5ddd9ffaf11
Don't crash trying to list a solution file if no cache exists yet.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 24 Sep 2020 22:56:34 -0700 |
parents | ff4590b2503a |
children | 4ba6df1b2f97 |
files | scripts/list_sln_files.py |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/list_sln_files.py Thu Sep 24 22:55:56 2020 -0700 +++ b/scripts/list_sln_files.py Thu Sep 24 22:56:34 2020 -0700 @@ -31,9 +31,13 @@ cache, loaded = SolutionCache.load_or_rebuild(args.solution, args.cache) if loaded and args.list_cache: - cache_dt = os.path.getmtime(args.cache) - list_cache_dt = os.path.getmtime(args.list_cache) - if list_cache_dt > cache_dt: + caches_exist = True + try: + cache_dt = os.path.getmtime(args.cache) + list_cache_dt = os.path.getmtime(args.list_cache) + except OSError: + caches_exist = False + if caches_exist and list_cache_dt > cache_dt: logger.debug("Solution cache was valid, re-using the file list cache.") try: with open(args.list_cache, 'r') as fp: