Fix config file load for bad/old style Python syntax
This commit is contained in:
parent
c04b6f6fdf
commit
f4c94c48b4
@ -299,7 +299,12 @@ class ConfigManager:
|
|||||||
continue # with next setting
|
continue # with next setting
|
||||||
####################### End upgrade code
|
####################### End upgrade code
|
||||||
else:
|
else:
|
||||||
value = safe_eval(raw_value)
|
try:
|
||||||
|
value = safe_eval(raw_value)
|
||||||
|
except:
|
||||||
|
# most likely exception is SyntaxError but
|
||||||
|
# others are possible ex: '0L' from Python2 days
|
||||||
|
value = None
|
||||||
####################### Now, let's test and set:
|
####################### Now, let's test and set:
|
||||||
if (name in self.default and
|
if (name in self.default and
|
||||||
setting in self.default[name]):
|
setting in self.default[name]):
|
||||||
|
Loading…
Reference in New Issue
Block a user