Commit b79430c5 authored by Robert Bradshaw's avatar Robert Bradshaw

Fix embed_position encoding bug.

parent 3aad1ec5
...@@ -47,7 +47,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -47,7 +47,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if Options.embed_pos_in_docstring: if Options.embed_pos_in_docstring:
env.doc = EncodedString(u'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: if not self.doc is None:
env.doc = EncodedString(env.doc + u'\\n' + self.doc) env.doc = EncodedString(env.doc + u'\n' + self.doc)
env.doc.encoding = self.doc.encoding env.doc.encoding = self.doc.encoding
else: else:
env.doc = self.doc env.doc = self.doc
......
...@@ -63,7 +63,7 @@ def embed_position(pos, docstring): ...@@ -63,7 +63,7 @@ def embed_position(pos, docstring):
# reuse the string encoding of the original docstring # reuse the string encoding of the original docstring
doc = EncodedString(pos_line) doc = EncodedString(pos_line)
else: else:
doc = EncodedString(pos_line + u'\\n' + docstring) doc = EncodedString(pos_line + u'\n' + docstring)
doc.encoding = encoding doc.encoding = encoding
return doc return doc
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment