diff options
author | 2019-09-23 12:01:57 +1000 | |
---|---|---|
committer | 2019-09-23 12:01:57 +1000 | |
commit | b385db0f08fb8bb3d46cf8f820d5dd525d7b2272 (patch) | |
tree | 9e84452b47543f3dd7ea1161a81d2feb05c961c5 | |
parent | Change volume instruction to single line. (diff) |
Check explicitly if file exists rather than any existing path.
Co-Authored-By: Mark <[email protected]>
-rw-r--r-- | bot/utils/persist.py | 2 |
1 files changed, 1 insertions, 1 deletions
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) |