Merge "Except block now covers specific errors"
This commit is contained in:
commit
f4e8ada922
@ -60,7 +60,7 @@ def get_result(path, section, key, default=None):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
config.read(path)
|
config.read(path)
|
||||||
except Exception:
|
except (OSError, ConfigParser.ParsingError):
|
||||||
msg = "The file '{}' is not in a valid INI format.".format(path)
|
msg = "The file '{}' is not in a valid INI format.".format(path)
|
||||||
ret = ReturnValue.INVALID_FORMAT
|
ret = ReturnValue.INVALID_FORMAT
|
||||||
return (ret, msg, value)
|
return (ret, msg, value)
|
||||||
|
Loading…
Reference in New Issue
Block a user