From 2f90fe4ea40d47ff44c60c82cc887574c4e02b28 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Fri, 24 Jan 2020 13:38:26 -0600 Subject: Remove using of `missing_ok` This is to be compatible with python 3.6 & 3.7 --- config_file/config_file.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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() -- cgit v1.2.3