Merge "Optimize "open" method with context manager"
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user