Significantly improve yaml load times when the C loader is available (#73337)

This commit is contained in:
J. Nick Koston
2022-06-13 08:44:46 -10:00
committed by GitHub
parent b84e844c76
commit dca4d3cd61
8 changed files with 190 additions and 78 deletions

View File

@ -191,7 +191,7 @@ def check(config_dir, secrets=False):
if secrets:
# Ensure !secrets point to the patched function
yaml_loader.SafeLineLoader.add_constructor("!secret", yaml_loader.secret_yaml)
yaml_loader.add_constructor("!secret", yaml_loader.secret_yaml)
def secrets_proxy(*args):
secrets = Secrets(*args)
@ -219,9 +219,7 @@ def check(config_dir, secrets=False):
pat.stop()
if secrets:
# Ensure !secrets point to the original function
yaml_loader.SafeLineLoader.add_constructor(
"!secret", yaml_loader.secret_yaml
)
yaml_loader.add_constructor("!secret", yaml_loader.secret_yaml)
return res