All tests pass!

This commit is contained in:
2024-08-14 23:48:30 -04:00
parent 52b44367c0
commit b36c849790
5 changed files with 95 additions and 67 deletions

View File

@@ -5,6 +5,7 @@
import os
import errno
from fnmatch import fnmatch
import warnings
def search_all_match(filename, path):
# search part shamelessly copied from stack overflow...
@@ -42,7 +43,6 @@ def select_path(paths):
def search_file(filename, path):
paths = search_all_match(filename, path)
if len(paths) == 0 :
print(f"No match for \"{filename}\". Link not modified.")
raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), filename)
raise Exception(f"No match found for {filename}")
p = select_path(paths)
return p