From: Stefan Behnel Date: Wed, 29 Dec 2010 10:40:52 +0000 (+0100) Subject: fix annotation writing after changing source position comments X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ed53fdd918ad67ef0d1689ddec0b389f3d8268d6;p=cython.git fix annotation writing after changing source position comments --- diff --git a/Cython/Compiler/Annotate.py b/Cython/Compiler/Annotate.py index fe38378b..cfdcfaed 100644 --- a/Cython/Compiler/Annotate.py +++ b/Cython/Compiler/Annotate.py @@ -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() diff --git a/Cython/Compiler/Scanning.py b/Cython/Compiler/Scanning.py index c2d1a9f6..cc51ba15 100644 --- a/Cython/Compiler/Scanning.py +++ b/Cython/Compiler/Scanning.py @@ -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)