Fix #1984 : KeyError in preferences.py if key not in stored config

This commit is contained in:
Calum Lind 2011-12-01 19:30:57 +00:00
parent 370035ffc5
commit eb70a7a6dc
1 changed files with 4 additions and 1 deletions

View File

@ -727,7 +727,10 @@ class Preferences(component.Component):
config_to_set = {}
for key in new_core_config.keys():
# The values do not match so this needs to be updated
if self.core_config[key] != new_core_config[key]:
try:
if self.core_config[key] != new_core_config[key]:
config_to_set[key] = new_core_config[key]
except KeyError:
config_to_set[key] = new_core_config[key]
if config_to_set: