Also catch errors on config save

This commit is contained in:
louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 2010-12-17 14:48:31 +00:00
parent c7515605a7
commit a41b036155

View file

@ -123,7 +123,11 @@ class Config(RawConfigParser):
set the value in the configuration then save it
to the file
"""
RawConfigParser.set(self, section, option, value)
try:
RawConfigParser.set(self, section, option, value)
except NoSectionError:
# TODO, add this section if it didn't exist
return
self.write_in_file(section, option, value)
# creates the configuration directory if it doesn't exist