Code: Select all
TEST: &test !include test.yaml
TEST:
content1: value1
content2: value2
content1: value1
content2: value2
Code: Select all
def _getConfigWithInclusions(path, inclusionHandler):
yaml = YAML()
yaml.Constructor.add_constructor('!include', inclusionHandler)
try:
with open(path) as stream:
res = yaml.load(stream)
except YAMLError as e:
raise RuntimeError(f'Most likely config file {path} is corrupted.', e)
return res
< /code>
, aber ich habe auf das [url=viewtopic.php?t=11587]Problem[/url] gestoßen: < /p>
ruamel.yaml.constructor.ConstructorError: while constructing a mapping
in ".../config/yaml/default/sim_top.yaml", line 2, column 1
expected a mapping or list of mappings for merging, but found scalar
in ".../config/yaml/default/sim_top.yaml", line 2, column 10
Dies scheint sowohl für Ruamel /> Bitte können Sie helfen, einige Problemumgehungen für diesen Fall zu finden?