summaryrefslogtreecommitdiff
path: root/comments.py
diff options
context:
space:
mode:
Diffstat (limited to 'comments.py')
-rw-r--r--comments.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/comments.py b/comments.py
index 6d1c4d8..6d2eb6b 100644
--- a/comments.py
+++ b/comments.py
@@ -394,6 +394,8 @@ class CommentedBase:
if before == '\n':
c[1].append(comment_token("", start_mark))
elif before:
+ if c[1] is None:
+ c[1] = []
for com in before.split('\n'):
c[1].append(comment_token(com, start_mark))
if after: