summaryrefslogtreecommitdiff
path: root/representer.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2021-04-07 21:49:28 +0200
committerAnthon van der Neut <anthon@mnt.org>2021-04-07 21:49:28 +0200
commitfc9c33962bc4f91dd2c46e002cc8a433d05b2f88 (patch)
tree17193a692c890694dddc3554645e8351ecb920a9 /representer.py
parent615e8c5a2e24eb5ffa0ff623cd616d88ca430e50 (diff)
downloadruamel.yaml-fc9c33962bc4f91dd2c46e002cc8a433d05b2f88.tar.gz
partial fix for 3510.17.4
Diffstat (limited to 'representer.py')
-rw-r--r--representer.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/representer.py b/representer.py
index d82cc3e..32e6f58 100644
--- a/representer.py
+++ b/representer.py
@@ -863,7 +863,9 @@ class RoundTripRepresenter(SafeRepresenter):
node_value = self.represent_data(item_value)
item_comment = item_comments.get(item_key)
if item_comment:
- assert getattr(node_key, 'comment', None) is None
+ # assert getattr(node_key, 'comment', None) is None
+ # issue 351 did throw this because the comment from the list item was
+ # moved to the dict
node_key.comment = item_comment[:2]
nvc = getattr(node_value, 'comment', None)
if nvc is not None: # end comment already there