mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
loaders: ensure loader stream closed in load_yaml_config()
This commit is contained in:
parent
8e51ddc544
commit
b5cf79072d
@ -37,8 +37,15 @@ def to_file_url(filename):
|
||||
#=================================================================
|
||||
def load_yaml_config(config_file):
|
||||
import yaml
|
||||
configdata = BlockLoader().load(config_file)
|
||||
config = yaml.load(configdata)
|
||||
config = None
|
||||
configdata = None
|
||||
try:
|
||||
configdata = BlockLoader().load(config_file)
|
||||
config = yaml.load(configdata)
|
||||
finally:
|
||||
if configdata:
|
||||
configdata.close()
|
||||
|
||||
return config
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user