From e420074c833f39c3157a7804a8d0d3bc97a2f8e9 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 7 Apr 2019 23:35:00 -0700 Subject: [PATCH] Use correct errors in find_path() * FileNotFoundError is accurate since we're just looking for a path --- .bin/Scripts/functions/ufd.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.bin/Scripts/functions/ufd.py b/.bin/Scripts/functions/ufd.py index e6a13c47..83dd1852 100644 --- a/.bin/Scripts/functions/ufd.py +++ b/.bin/Scripts/functions/ufd.py @@ -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)