diff options
author | Anthon van der Neut <anthon@mnt.org> | 2021-05-30 09:25:32 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2021-05-30 09:25:32 +0200 |
commit | 73f4bec5f498b31fd7ce7c2ac7ced187b4fc4920 (patch) | |
tree | e2318c5891b58aecebdb178636c61b7aa6a84193 /representer.py | |
parent | 17b35c376fd0fc9a94ba0adfdbf5bf63a6177dc9 (diff) | |
download | ruamel.yaml-73f4bec5f498b31fd7ce7c2ac7ced187b4fc4920.tar.gz |
fix for issue 3840.17.5
aliased scalars in !!set would not round trip with ?
Diffstat (limited to 'representer.py')
-rw-r--r-- | representer.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/representer.py b/representer.py index f3e3e43..4b78c65 100644 --- a/representer.py +++ b/representer.py @@ -837,13 +837,17 @@ class RoundTripRepresenter(SafeRepresenter): for ct in node.comment[1]: ct.reset() item_comments = comment.items - for v in item_comments.values(): - if v and v[1]: - for ct in v[1]: - ct.reset() - try: - node.comment.append(comment.end) - except AttributeError: + if self.dumper.comment_handling is None: + for v in item_comments.values(): + if v and v[1]: + for ct in v[1]: + ct.reset() + try: + node.comment.append(comment.end) + except AttributeError: + pass + else: + # NEWCMNT pass except AttributeError: item_comments = {} |