From 9d3a403f8a04e787e4fc4dbcbefb3230c32a0fec Mon Sep 17 00:00:00 2001 From: "Nicklas H." Date: Fri, 23 Aug 2024 12:50:06 +0200 Subject: [PATCH] Update set_file_paths to explicitly check if the paths are not None, instead of using assert --- settings/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/settings/utils.py b/settings/utils.py index 74187a5..c219d8a 100644 --- a/settings/utils.py +++ b/settings/utils.py @@ -52,8 +52,11 @@ def set_file_paths( if path: read_path = path write_path = path - assert read_path is not None and write_path is not None - return Path(read_path).resolve(), Path(write_path).resolve() + + if read_path is not None and write_path is not None: + return Path(read_path).resolve(), Path(write_path).resolve() + else: + raise MissingPathError("You must provide both a read_path and write_path.") @overload