Merge "Optimize "open" method with context manager"

This commit is contained in:
Jenkins
2015-12-02 14:30:33 +00:00
committed by Gerrit Code Review

View File

@@ -28,8 +28,8 @@ LOG = logging.getLogger(__name__)
def read_accounts_yaml(path):
yaml_file = open(path, 'r')
accounts = yaml.load(yaml_file)
with open(path, 'r') as yaml_file:
accounts = yaml.load(yaml_file)
return accounts