Fix crash and bug in AnnotationCCodeWriter 0.9.8.1
authorHoytKoepke <none@none>
Tue, 19 Aug 2008 02:02:28 +0000 (19:02 -0700)
committerHoytKoepke <none@none>
Tue, 19 Aug 2008 02:02:28 +0000 (19:02 -0700)
Cython/Compiler/Annotate.py

index 5f6ca4174b267caef179a1910546befa2ce947cb..4a8a27bb2493ae145c15328b1806275206132266 100644 (file)
@@ -19,8 +19,8 @@ class AnnotationCCodeWriter(CCodeWriter):
 
     def __init__(self, create_from=None, buffer=None, copy_formatting=True):
         CCodeWriter.__init__(self, create_from, buffer, copy_formatting=True)
-        self.annotation_buffer = StringIO()
         if create_from is None:
+            self.annotation_buffer = StringIO()
             self.annotations = []
             self.last_pos = None
             self.code = {}
@@ -29,7 +29,8 @@ class AnnotationCCodeWriter(CCodeWriter):
             self.annotation_buffer = create_from.annotation_buffer
             self.annotations = create_from.annotations
             self.code = create_from.code
-
+            self.last_pos = create_from.last_pos
+    
     def create_new(self, create_from, buffer, copy_formatting):
         return AnnotationCCodeWriter(create_from, buffer, copy_formatting)