1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #19272 -- Fixed gettext_lazy returned type on Python 2

Thanks tyrion for the report.
This commit is contained in:
Claude Paroz
2012-11-14 10:50:15 +01:00
parent 1620c27936
commit 550ddc66b4
2 changed files with 6 additions and 1 deletions

View File

@@ -246,7 +246,8 @@ def do_translate(message, translation_function):
"""
global _default
eol_message = message.replace('\r\n', '\n').replace('\r', '\n')
# str() is allowing a bytestring message to remain bytestring on Python 2
eol_message = message.replace(str('\r\n'), str('\n')).replace(str('\r'), str('\n'))
t = getattr(_active, "value", None)
if t is not None:
result = getattr(t, translation_function)(eol_message)