Close config file after loading it.

Prevents a ResourceWarning when all warnings are enabled.
This commit is contained in:
auouymous 2022-04-17 03:14:32 -06:00
parent 41c312dd68
commit 33aaf2a4eb
1 changed files with 2 additions and 1 deletions

View File

@ -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',