Unverified Commit 1dab412c authored by TFWol's avatar TFWol Committed by GitHub
Browse files

Add error handling to initial fix to keep cache intact

parent 4ab0392f
...@@ -139,6 +139,13 @@ def recursive_search(directory, excluded_dir_names=None): ...@@ -139,6 +139,13 @@ def recursive_search(directory, excluded_dir_names=None):
result = [] result = []
dirs = {} dirs = {}
# Attempt to add the initial directory to dirs with error handling
try:
dirs[directory] = os.path.getmtime(directory)
except FileNotFoundError:
print(f"Warning: Unable to access {directory}. Skipping this path.")
for dirpath, subdirs, filenames in os.walk(directory, followlinks=True, topdown=True): for dirpath, subdirs, filenames in os.walk(directory, followlinks=True, topdown=True):
subdirs[:] = [d for d in subdirs if d not in excluded_dir_names] subdirs[:] = [d for d in subdirs if d not in excluded_dir_names]
for file_name in filenames: for file_name in filenames:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment