From: Robert Bradshaw Date: Wed, 13 Aug 2008 08:13:29 +0000 (-0700) Subject: embed positions fix X-Git-Tag: 0.9.8.1~49^2~5^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=296cc2dffe27078c0a507217714c92c1ca2596d5;p=cython.git embed positions fix --- diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 03dfe382..5e954231 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -23,7 +23,7 @@ import Version from Errors import error, warning from PyrexTypes import py_object_type -from Cython.Utils import open_new_file, replace_suffix, escape_byte_string +from Cython.Utils import open_new_file, replace_suffix, escape_byte_string, EncodedString def check_c_classes(module_node): @@ -45,9 +45,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): def analyse_declarations(self, env): if Options.embed_pos_in_docstring: - env.doc = 'File: %s (starting at line %s)'%Nodes.relative_position(self.pos) + env.doc = EncodedString(u'File: %s (starting at line %s)' % Nodes.relative_position(self.pos)) if not self.doc is None: - env.doc = env.doc + '\\n' + self.doc + env.doc = EncodedString(env.doc + u'\\n' + self.doc) + env.doc.encoding = self.doc.encoding else: env.doc = self.doc self.body.analyse_declarations(env)