summaryrefslogtreecommitdiff
path: root/emitter.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2018-08-13 11:15:32 +0200
committerAnthon van der Neut <anthon@mnt.org>2018-08-13 11:15:32 +0200
commitc6c7a98673690f6c46c80c88ba2909b7721fd40a (patch)
tree678b61ea38d89e4c5f9165586366fbce9a4bedde /emitter.py
parentb49a56399b1086eabf0abb9d86297188db108c19 (diff)
downloadruamel.yaml-c6c7a98673690f6c46c80c88ba2909b7721fd40a.tar.gz
fix issue 102 now also for empty mappings with comments0.15.54
*When this change indeed resolves your problem, please **Close** this issue*. *(You can do so usingthe WorkFlow pull-down (close to the top right of this page)*
Diffstat (limited to 'emitter.py')
-rw-r--r--emitter.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/emitter.py b/emitter.py
index 4dc053e..7fb572a 100644
--- a/emitter.py
+++ b/emitter.py
@@ -507,9 +507,9 @@ class Emitter(object):
self.indent = self.indents.pop()
self.flow_level -= 1
self.write_indicator(u'}', False)
- # if self.event.comment and self.event.comment[0]:
- # # eol comment on flow sequence
- # self.write_post_comment(self.event)
+ if self.event.comment and self.event.comment[0]:
+ # eol comment on empty mapping
+ self.write_post_comment(self.event)
self.state = self.states.pop()
else:
if self.canonical or self.column > self.best_width:
@@ -534,7 +534,7 @@ class Emitter(object):
self.write_indent()
self.write_indicator(u'}', False)
if self.event.comment and self.event.comment[0]:
- # eol comment on flow mapping
+ # eol comment on flow mapping, never reached on empty mappings
self.write_post_comment(self.event)
self.state = self.states.pop()
else: