fix annotation writing after changing source position comments
authorStefan Behnel <scoder@users.berlios.de>
Wed, 29 Dec 2010 10:40:52 +0000 (11:40 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 29 Dec 2010 10:40:52 +0000 (11:40 +0100)
Cython/Compiler/Annotate.py
Cython/Compiler/Scanning.py

index fe38378b37a7e1955993aa270c6ebd990f70266a..cfdcfaed246e38edf89127f5ac52c1b4c840aa39 100644 (file)
@@ -44,7 +44,7 @@ class AnnotationCCodeWriter(CCodeWriter):
         if pos is not None:
             CCodeWriter.mark_pos(self, pos)
         if self.last_pos:
-            pos_code = self.code.setdefault(self.last_pos[0].get_description(),{})
+            pos_code = self.code.setdefault(self.last_pos[0].filename,{})
             code = pos_code.get(self.last_pos[1], "")
             pos_code[self.last_pos[1]] = code + self.annotation_buffer.getvalue()
         self.annotation_buffer = StringIO()
index c2d1a9f6dd41fcb3b0f92831996597a42e6a9edd..cc51ba1523dca33f8428f45d936d75a30d4fb5f0 100644 (file)
@@ -200,6 +200,8 @@ class StringSourceDescriptor(SourceDescriptor):
     Instances of this class can be used instead of a filenames if the
     code originates from a string object.
     """
+    filename = None
+
     def __init__(self, name, code):
         self.name = name
         #self.set_file_type_from_name(name)