Fix up error handling

bzr-revno: 182
This commit is contained in:
Tim Bentley 2008-12-05 20:01:31 +00:00
parent fce0830e56
commit 753eee645c

View File

@ -41,16 +41,19 @@ class LinRegistry(Registry):
"""
Get a single value from the registry.
"""
if self.config.has_value(section, key):
return self.config.get(section, key)
else:
try:
if self.config.get(section, key):
return self.config.get(section, key)
else:
return default
except:
return default
def set_value(self, section, key, value):
"""
Set a single value in the registry.
"""
try:
try :
self.config.set(section, key, value)
return self._save()
except: