Ignore corrupted conversion config files instead of failling to convert

See #1306854 (Error when trying to convert)
This commit is contained in:
Kovid Goyal 2014-04-12 08:38:28 +05:30
parent 29fdb8dc62
commit cd7da5743e

View File

@ -78,7 +78,7 @@ class GuiRecommendations(dict):
def from_string(self, raw): def from_string(self, raw):
try: try:
d = eval(raw) d = eval(raw)
except SyntaxError: except (SyntaxError, TypeError):
d = None d = None
if d: if d:
self.update(d) self.update(d)
@ -89,7 +89,8 @@ class GuiRecommendations(dict):
if only_existing and name not in self: if only_existing and name not in self:
continue continue
opt = get_option(name) opt = get_option(name)
if opt is None: continue if opt is None:
continue
if opt.level == OptionRecommendation.HIGH: if opt.level == OptionRecommendation.HIGH:
self[name] = opt.recommended_value self[name] = opt.recommended_value
self.disabled_options.add(name) self.disabled_options.add(name)