summaryrefslogtreecommitdiff
path: root/comments.py
diff options
context:
space:
mode:
Diffstat (limited to 'comments.py')
-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: