diff --git a/os_service_types/data/__init__.py b/os_service_types/data/__init__.py index bc3c704..68991b0 100644 --- a/os_service_types/data/__init__.py +++ b/os_service_types/data/__init__.py @@ -21,5 +21,10 @@ DATA_DIR = os.path.dirname(__file__) def read_data(filename): - """Return data that is shipped inside the python package.""" - return json.load(open(os.path.join(DATA_DIR, filename), 'r')) + """Return data that is shipped inside the Python package. + + """ + + filepath = os.path.join(DATA_DIR, filename) + with open(filepath, 'r') as fd: + return json.load(fd)