From b385db0f08fb8bb3d46cf8f820d5dd525d7b2272 Mon Sep 17 00:00:00 2001 From: scragly <29337040+scragly@users.noreply.github.com> Date: Mon, 23 Sep 2019 12:01:57 +1000 Subject: Check explicitly if file exists rather than any existing path. Co-Authored-By: Mark --- bot/utils/persist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bot/utils/persist.py') diff --git a/bot/utils/persist.py b/bot/utils/persist.py index 06c3764a..35e1e41a 100644 --- a/bot/utils/persist.py +++ b/bot/utils/persist.py @@ -23,7 +23,7 @@ def datafile(file_path: Path) -> Path: >>> clean_default_datafile = Path("bot", "resources", "datafile.json") >>> persistent_file_path = datafile(clean_default_datafile) """ - if not file_path.exists(): + if not file_path.is_file(): raise OSError(f"File not found at {file_path}.") persistant_path = Path(DIRECTORY, file_path.name) -- cgit v1.2.3