aboutsummaryrefslogtreecommitdiffstats
path: root/config_file
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2020-01-24 13:38:26 -0600
committerEugene Triguba <eugenetriguba@gmail.com>2020-01-24 13:38:26 -0600
commit2f90fe4ea40d47ff44c60c82cc887574c4e02b28 (patch)
tree7a65dadada0b0c4afbcc76f0eb763f49d3cde0b0 /config_file
parentInstall poetry via curl in travic ci and update lock file (diff)
downloadconfig-file-2f90fe4ea40d47ff44c60c82cc887574c4e02b28.zip
Remove using of `missing_ok`
This is to be compatible with python 3.6 & 3.7
Diffstat (limited to 'config_file')
-rw-r--r--config_file/config_file.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/config_file/config_file.py b/config_file/config_file.py
index b090ace..5827d08 100644
--- a/config_file/config_file.py
+++ b/config_file/config_file.py
@@ -118,7 +118,11 @@ class ConfigFile:
if not Path(original_file_path).exists():
raise OSError(f"The {original_file_path} file to reset to does not exist.")
- Path(self.path).expanduser().unlink(missing_ok=True)
+ try:
+ Path(self.path).expanduser().unlink()
+ except OSError:
+ pass
+
copyfile(original_file_path, self.path)
self.contents = self.__read_config_file()