summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2018-08-13 14:41:59 +0200
committerAnthon van der Neut <anthon@mnt.org>2018-08-13 14:41:59 +0200
commit77e95d12bc81252e43e10bc8977687633f7c4572 (patch)
tree9076bc445225137ac30020be391b2fdc64b82e9a
parent9bf81ebee695c0d7ea754e3937f457f3077ac5f1 (diff)
downloadruamel.yaml-77e95d12bc81252e43e10bc8977687633f7c4572.tar.gz
fix issue #184 adding eol comment
this was not possible without explicit column specification and no neighbouring comment was available. Thanks for reporting *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)*
-rw-r--r--comments.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/comments.py b/comments.py
index ff0080f..c98baf8 100644
--- a/comments.py
+++ b/comments.py
@@ -297,7 +297,10 @@ class CommentedBase(object):
from .error import CommentMark
if column is None:
- column = self._yaml_get_column(key)
+ try:
+ column = self._yaml_get_column(key)
+ except AttributeError:
+ column = 0
if comment[0] != '#':
comment = '# ' + comment
if column is None: