mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +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):
|
def load_yaml_config(config_file):
|
||||||
import yaml
|
import yaml
|
||||||
configdata = BlockLoader().load(config_file)
|
config = None
|
||||||
config = yaml.load(configdata)
|
configdata = None
|
||||||
|
try:
|
||||||
|
configdata = BlockLoader().load(config_file)
|
||||||
|
config = yaml.load(configdata)
|
||||||
|
finally:
|
||||||
|
if configdata:
|
||||||
|
configdata.close()
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user