summaryrefslogtreecommitdiff
path: root/src/config.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-12-17 14:48:31 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-12-17 14:48:31 +0000
commita41b036155d2c544e7c35edd743fc85219ae1977 (patch)
tree59c840695c71c9f770bc2cd56354d925f8dbb17e /src/config.py
parentc7515605a73e984818d76eebb57c99d7fcaffbe6 (diff)
downloadpoezio-a41b036155d2c544e7c35edd743fc85219ae1977.tar.gz
poezio-a41b036155d2c544e7c35edd743fc85219ae1977.tar.bz2
poezio-a41b036155d2c544e7c35edd743fc85219ae1977.tar.xz
poezio-a41b036155d2c544e7c35edd743fc85219ae1977.zip
Also catch errors on config save
Diffstat (limited to 'src/config.py')
-rw-r--r--src/config.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/config.py b/src/config.py
index 4bb646b3..97be4946 100644
--- a/src/config.py
+++ b/src/config.py
@@ -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