settings: close local settings file (#61976)

This commit is contained in:
Nicolas Roche 2022-02-18 17:25:30 +01:00
parent 08ce9df1cc
commit 1408cb57c4
2 changed files with 4 additions and 2 deletions

View File

@ -52,4 +52,5 @@ local_settings_file = os.environ.get(
'HOBO_AGENT_SETTINGS_FILE', os.path.join(os.path.dirname(__file__), 'local_settings.py')
)
if os.path.exists(local_settings_file):
exec(open(local_settings_file).read())
with open(local_settings_file) as f:
exec(f.read())

View File

@ -222,4 +222,5 @@ local_settings_file = os.environ.get(
'HOBO_SETTINGS_FILE', os.path.join(os.path.dirname(__file__), 'local_settings.py')
)
if os.path.exists(local_settings_file):
exec(open(local_settings_file).read())
with open(local_settings_file) as f:
exec(f.read())