diff options
Diffstat (limited to 'gallery_dl/config.py')
| -rw-r--r-- | gallery_dl/config.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gallery_dl/config.py b/gallery_dl/config.py index c2787ad..5303616 100644 --- a/gallery_dl/config.py +++ b/gallery_dl/config.py @@ -22,8 +22,9 @@ log = logging.getLogger("config") _config = {} -if os.name == "nt": +if util.WINDOWS: _default_configs = [ + r"%APPDATA%\gallery-dl\config.json", r"%USERPROFILE%\gallery-dl\config.json", r"%USERPROFILE%\gallery-dl.conf", ] @@ -139,7 +140,6 @@ def unset(path, key, *, conf=_config): class apply(): """Context Manager: apply a collection of key-value pairs""" - _sentinel = object() def __init__(self, kvlist): self.original = [] @@ -147,12 +147,12 @@ class apply(): def __enter__(self): for path, key, value in self.kvlist: - self.original.append((path, key, get(path, key, self._sentinel))) + self.original.append((path, key, get(path, key, util.SENTINEL))) set(path, key, value) def __exit__(self, etype, value, traceback): for path, key, value in self.original: - if value is self._sentinel: + if value is util.SENTINEL: unset(path, key) else: set(path, key, value) |
