Skip to content
Snippets Groups Projects
Commit dd83aafd authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

py3: get around unicode docstrings in test-encoding-textwrap.t and test-help.t

On Python 3, docstrings are converted back to utf-8 bytes, which practically
disables the "if type(message) is pycompat.unicode" hack in gettext(). Let's
add one more workaround for the Py3 path.
parent 682f73fa
No related branches found
No related tags found
No related merge requests found
......@@ -75,7 +75,9 @@
# goofy unicode docstrings in test
paragraphs = message.split(u'\n\n')
else:
paragraphs = [p.decode("ascii") for p in message.split('\n\n')]
# should be ascii, but we have unicode docstrings in test, which
# are converted to utf-8 bytes on Python 3.
paragraphs = [p.decode("utf-8") for p in message.split('\n\n')]
# Be careful not to translate the empty string -- it holds the
# meta data of the .po file.
u = u'\n\n'.join([p and _ugettext(p) or u'' for p in paragraphs])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment