Skip to content

Commit

Permalink
Merge a24d4b3 into c71c0c5
Browse files Browse the repository at this point in the history
  • Loading branch information
idanov committed Jun 8, 2018
2 parents c71c0c5 + a24d4b3 commit aa90062
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions anyconfig/backend/yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def construct_mapping(loader, node, deep=False):
"""Construct python object from yaml mapping node, based on
:meth:`yaml.BaseConstructor.construct_mapping` in PyYAML (MIT).
"""
loader.flatten_mapping(node)
if not isinstance(node, yaml.MappingNode):
msg = "expected a mapping node, but found %s" % node.id
raise yaml.constructor.ConstructorError(None, None, msg,
Expand Down
10 changes: 8 additions & 2 deletions tests/backend/yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@
- 2
- 3
sect0:
sect0: &sect0
d: ["x", "y", "z"]
sect1:
<<: *sect0
e: true
"""

CNF = OrderedDict((("a", 0), ("b", "bbb"), ("c", [1, 2, 3]),
("sect0", OrderedDict((("d", "x y z".split()), )))))
("sect0", OrderedDict((("d", "x y z".split()), ))),
("sect1", OrderedDict((("d", "x y z".split()), ("e",
True),)))
))


class HasParserTrait(TBC.HasParserTrait):
Expand Down

0 comments on commit aa90062

Please sign in to comment.