silence ENOTDIR when loading config file
This commit is contained in:
parent
26f413e1e5
commit
06f96df67e
2 changed files with 10 additions and 2 deletions
|
|
@ -129,7 +129,9 @@ class Config(dict):
|
|||
with open(filename, mode='rb') as config_file:
|
||||
exec(compile(config_file.read(), filename, 'exec'), d.__dict__)
|
||||
except IOError as e:
|
||||
if silent and e.errno in (errno.ENOENT, errno.EISDIR):
|
||||
if silent and e.errno in (
|
||||
errno.ENOENT, errno.EISDIR, errno.ENOTDIR
|
||||
):
|
||||
return False
|
||||
e.strerror = 'Unable to load configuration file (%s)' % e.strerror
|
||||
raise
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue