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. Get a single value from the registry.
""" """
if self.config.has_value(section, key): try:
return self.config.get(section, key) if self.config.get(section, key):
else: return self.config.get(section, key)
else:
return default
except:
return default return default
def set_value(self, section, key, value): def set_value(self, section, key, value):
""" """
Set a single value in the registry. Set a single value in the registry.
""" """
try: try :
self.config.set(section, key, value) self.config.set(section, key, value)
return self._save() return self._save()
except: except: