From 3fa2561f16f684bb83aa9b3dcacb44171b04ddc5 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 1 Aug 2020 11:56:44 -0500 Subject: Raise FileNotFoundError if the config file does not exist --- config_file/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config_file/utils.py b/config_file/utils.py index a75968c..4d8bb36 100644 --- a/config_file/utils.py +++ b/config_file/utils.py @@ -39,6 +39,11 @@ def create_config_path(file_path: Path, original: bool = False) -> Path: if file_path.is_dir(): raise ValueError(f"The specified config file ({file_path}) is a directory.") + if not file_path.exists(): + raise FileNotFoundError( + f"The specified config file ({file_path}) does not exist." + ) + return file_path -- cgit v1.2.3