From 296cc2dffe27078c0a507217714c92c1ca2596d5 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 13 Aug 2008 01:13:29 -0700 Subject: [PATCH] embed positions fix --- Cython/Compiler/ModuleNode.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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) -- 2.26.2