Skip to content

Commit f4c21b0

Browse files
committed
Close config file when loading settings.
1 parent dcec492 commit f4c21b0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/api/util/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
from __future__ import with_statement
12
import json
23

34

45
def get_settings():
56
"""Parses the settings from redis-live.conf.
67
"""
78
# TODO: Consider YAML. Human writable, machine readable.
8-
return json.load(open("redis-live.conf"))
9+
with open("redis-live.conf") as config:
10+
return json.load(config)
911

1012

1113
def get_redis_servers():

0 commit comments

Comments
 (0)