mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-03-27 09:58:31 +07:00
Prevent ResourceWarning due to unclosed file
This commit is contained in:
@@ -71,8 +71,8 @@ def load_config(filename='mkdocs.yml', options=None):
|
||||
if 'config' in options:
|
||||
filename = options['config']
|
||||
assert os.path.exists(filename), "Config file '%s' does not exist." % filename
|
||||
|
||||
user_config = yaml.load(open(filename, 'r'))
|
||||
with open(filename, 'r') as fp:
|
||||
user_config = yaml.load(fp)
|
||||
user_config.update(options)
|
||||
return validate_config(user_config)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user