Commit 66bc1c6f authored by HoytKoepke's avatar HoytKoepke

Fix crash and bug in AnnotationCCodeWriter

parent e4add80f
...@@ -19,8 +19,8 @@ class AnnotationCCodeWriter(CCodeWriter): ...@@ -19,8 +19,8 @@ class AnnotationCCodeWriter(CCodeWriter):
def __init__(self, create_from=None, buffer=None, copy_formatting=True): def __init__(self, create_from=None, buffer=None, copy_formatting=True):
CCodeWriter.__init__(self, create_from, buffer, copy_formatting=True) CCodeWriter.__init__(self, create_from, buffer, copy_formatting=True)
self.annotation_buffer = StringIO()
if create_from is None: if create_from is None:
self.annotation_buffer = StringIO()
self.annotations = [] self.annotations = []
self.last_pos = None self.last_pos = None
self.code = {} self.code = {}
...@@ -29,6 +29,7 @@ class AnnotationCCodeWriter(CCodeWriter): ...@@ -29,6 +29,7 @@ class AnnotationCCodeWriter(CCodeWriter):
self.annotation_buffer = create_from.annotation_buffer self.annotation_buffer = create_from.annotation_buffer
self.annotations = create_from.annotations self.annotations = create_from.annotations
self.code = create_from.code self.code = create_from.code
self.last_pos = create_from.last_pos
def create_new(self, create_from, buffer, copy_formatting): def create_new(self, create_from, buffer, copy_formatting):
return AnnotationCCodeWriter(create_from, buffer, copy_formatting) return AnnotationCCodeWriter(create_from, buffer, copy_formatting)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment