aboutsummaryrefslogtreecommitdiffstats
path: root/bot/utils/persist.py
diff options
context:
space:
mode:
authorGravatar scragly <[email protected]>2019-09-23 12:01:57 +1000
committerGravatar GitHub <[email protected]>2019-09-23 12:01:57 +1000
commitb385db0f08fb8bb3d46cf8f820d5dd525d7b2272 (patch)
tree9e84452b47543f3dd7ea1161a81d2feb05c961c5 /bot/utils/persist.py
parentChange volume instruction to single line. (diff)
Check explicitly if file exists rather than any existing path.
Co-Authored-By: Mark <[email protected]>
Diffstat (limited to 'bot/utils/persist.py')
-rw-r--r--bot/utils/persist.py2
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)