mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-21 03:54:50 +00:00
Catch exception when trying to open config file
This commit is contained in:
parent
019c78db47
commit
30efe143fe
1 changed files with 7 additions and 1 deletions
|
@ -281,7 +281,13 @@ class Config(object):
|
|||
"""
|
||||
if not filename:
|
||||
filename = self.__config_file
|
||||
data = open(filename, "rb")
|
||||
|
||||
try:
|
||||
data = open(filename, "rb")
|
||||
except IOError, e:
|
||||
log.warning("Unable to open config file %s: %s", filename, e)
|
||||
return
|
||||
|
||||
try:
|
||||
self.__format_version = int(data.readline())
|
||||
except ValueError:
|
||||
|
|
Loading…
Add table
Reference in a new issue