Use correct errors in find_path()
* FileNotFoundError is accurate since we're just looking for a path
This commit is contained in:
parent
50cb765108
commit
e420074c83
1 changed files with 5 additions and 1 deletions
|
|
@ -40,7 +40,11 @@ def find_path(path):
|
|||
|
||||
# Fix case
|
||||
for part in parts:
|
||||
real_path = case_insensitive_search(real_path, part)
|
||||
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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue