Close config file after loading it.
Prevents a ResourceWarning when all warnings are enabled.
This commit is contained in:
parent
41c312dd68
commit
33aaf2a4eb
|
@ -373,7 +373,8 @@ class Config(object):
|
|||
|
||||
if os.path.exists(self.__filename):
|
||||
try:
|
||||
data = open(self.__filename, 'rt').read()
|
||||
with open(self.__filename, 'rt') as f:
|
||||
data = f.read()
|
||||
new_keys_added = self.__json_config._restore(data)
|
||||
except:
|
||||
logger.warning('Cannot parse config file: %s',
|
||||
|
|
Loading…
Reference in New Issue