summaryrefslogtreecommitdiff
path: root/tokens.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2015-09-14 21:00:34 +0200
committerAnthon van der Neut <anthon@mnt.org>2015-09-14 21:00:34 +0200
commit458b666f85b015b328b2d70c4072e3804dd3903a (patch)
treebfcad575211664482f3809994d4513294e8c143f /tokens.py
parent23294d8492459f0268c02191cccee955bee8c206 (diff)
downloadruamel.yaml-458b666f85b015b328b2d70c4072e3804dd3903a.tar.gz
Fix Issue 11, double dump lost comments
The state 'pre_done' to keep comments from being printed twice was not cleared and on second dump would result in non-printing
Diffstat (limited to 'tokens.py')
-rw-r--r--tokens.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tokens.py b/tokens.py
index 452803f..95a43a5 100644
--- a/tokens.py
+++ b/tokens.py
@@ -186,3 +186,7 @@ class CommentToken(Token):
def __init__(self, value, start_mark, end_mark):
Token.__init__(self, start_mark, end_mark)
self.value = value
+
+ def reset(self):
+ if hasattr(self, 'pre_done'):
+ delattr(self, 'pre_done') \ No newline at end of file