- fix crash for empty config file
This commit is contained in:
parent
57ea4c76f2
commit
0cce9a60ca
1 changed files with 2 additions and 0 deletions
|
|
@ -649,6 +649,8 @@ class MainSettingsWindow():
|
|||
def config_set(self, context, key, value):
|
||||
config = ConfigParser(interpolation=None)
|
||||
config.read(self.config_file)
|
||||
if not context in config.sections():
|
||||
config.add_section(context)
|
||||
config.set(context, key, value)
|
||||
with open(self.config_file, 'w') as file:
|
||||
config.write(file)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue