Catch exception when trying to open config file
This commit is contained in:
parent
019c78db47
commit
30efe143fe
|
@ -281,7 +281,13 @@ class Config(object):
|
||||||
"""
|
"""
|
||||||
if not filename:
|
if not filename:
|
||||||
filename = self.__config_file
|
filename = self.__config_file
|
||||||
|
|
||||||
|
try:
|
||||||
data = open(filename, "rb")
|
data = open(filename, "rb")
|
||||||
|
except IOError, e:
|
||||||
|
log.warning("Unable to open config file %s: %s", filename, e)
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.__format_version = int(data.readline())
|
self.__format_version = int(data.readline())
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|
Loading…
Reference in New Issue