diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2020-01-26 17:07:28 -0600 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2020-01-26 17:07:28 -0600 |
| commit | 0bd9c725727b1e4a6d551b23dd67ab5615c7b52e (patch) | |
| tree | 78efebe231dce10b9ebbc47995b38972c3e9de84 /config_file | |
| parent | Test base parse function (diff) | |
| parent | Bump version: 0.5.0 → 0.6.0 (diff) | |
| download | config-file-0bd9c725727b1e4a6d551b23dd67ab5615c7b52e.zip | |
Merge branch 'master' of github.com:eugenetriguba/config_file
Diffstat (limited to 'config_file')
| -rw-r--r-- | config_file/__init__.py | 2 | ||||
| -rw-r--r-- | config_file/config_file.py | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/config_file/__init__.py b/config_file/__init__.py index 22164c1..5917edd 100644 --- a/config_file/__init__.py +++ b/config_file/__init__.py @@ -1,7 +1,7 @@ from config_file.config_file import ConfigFile from config_file.parsers.base_parser import BaseParser, ParsingError -__version__ = "0.5.0" +__version__ = "0.6.0" __all__ = [ "ConfigFile", 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() |