Use correct errors in find_path()

* FileNotFoundError is accurate since we're just looking for a path
This commit is contained in:
2Shirt 2019-04-07 23:35:00 -07:00
parent 50cb765108
commit e420074c83
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -40,7 +40,11 @@ def find_path(path):
# Fix case
for part in parts:
try:
real_path = case_insensitive_search(real_path, part)
except NotADirectoryError:
# Reclassify error
raise FileNotFoundError(path)
# Raise error if path doesn't exist
path_obj = pathlib.Path(real_path)