Skip to content

Commit

Permalink
Improvements to YAML support
Browse files Browse the repository at this point in the history
  • Loading branch information
hgrecco committed May 2, 2019
1 parent 5b4cc7e commit 882582b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions serialize/yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ class Loader(yaml.Loader):

def construct_object(self, node, deep=False):

if not isinstance(node, MappingNode):
return super().construct_object(node, deep)
# It seems that pyyaml is changing the internal structure of the node
tmp = super().construct_object(node, deep)

dct = super().construct_mapping(node, deep)
decoded = all.decode(dct)
if decoded is not dct:
return super().construct_object(node, deep)
if isinstance(node, MappingNode):
dct = super().construct_mapping(node, deep)
decoded = all.decode(dct)
if decoded is not dct:
return decoded

return decoded
return tmp



Expand Down

0 comments on commit 882582b

Please sign in to comment.