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
|
# Fix case
|
||||||
for part in parts:
|
for part in parts:
|
||||||
|
try:
|
||||||
real_path = case_insensitive_search(real_path, part)
|
real_path = case_insensitive_search(real_path, part)
|
||||||
|
except NotADirectoryError:
|
||||||
|
# Reclassify error
|
||||||
|
raise FileNotFoundError(path)
|
||||||
|
|
||||||
# Raise error if path doesn't exist
|
# Raise error if path doesn't exist
|
||||||
path_obj = pathlib.Path(real_path)
|
path_obj = pathlib.Path(real_path)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue