This commit is contained in:
Kovid Goyal 2022-03-09 08:08:21 +05:30
parent 0012b7cd64
commit c1a06e9c37
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -421,7 +421,9 @@ class Config(ConfigInterface):
raise ValueError('The option %s is not defined.'%name) raise ValueError('The option %s is not defined.'%name)
if not os.path.exists(config_dir): if not os.path.exists(config_dir):
make_config_dir() make_config_dir()
src = read_data(self.config_file_path) src = b''
with suppress(FileNotFoundError):
src = read_data(self.config_file_path)
opts = self.option_set.parse_string(src) opts = self.option_set.parse_string(src)
setattr(opts, name, val) setattr(opts, name, val)
src = self.option_set.serialize(opts) src = self.option_set.serialize(opts)