# HG changeset patch # User Ludovic Chabant # Date 1601013394 25200 # Node ID d5ddd9ffaf115c555bfb28111abc21bb772eb912 # Parent ff4590b2503ad45d7c9d70565a9f5e42941bab79 Don't crash trying to list a solution file if no cache exists yet. diff -r ff4590b2503a -r d5ddd9ffaf11 scripts/list_sln_files.py --- 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: