mercurial/i18n.py
changeset 48934 06de08b36c82
parent 48875 6000f5b25c9b
child 50929 18c8c18993f0
equal deleted inserted replaced
48933:78f1de3f4be7 48934:06de08b36c82
    83     if message is None or not _ugettext:
    83     if message is None or not _ugettext:
    84         return message
    84         return message
    85 
    85 
    86     cache = _msgcache.setdefault(encoding.encoding, {})
    86     cache = _msgcache.setdefault(encoding.encoding, {})
    87     if message not in cache:
    87     if message not in cache:
    88         if type(message) is pycompat.unicode:
    88         if type(message) is str:
    89             # goofy unicode docstrings in test
    89             # goofy unicode docstrings in test
    90             paragraphs = message.split(u'\n\n')  # type: List[pycompat.unicode]
    90             paragraphs = message.split(u'\n\n')  # type: List[str]
    91         else:
    91         else:
    92             # should be ascii, but we have unicode docstrings in test, which
    92             # should be ascii, but we have unicode docstrings in test, which
    93             # are converted to utf-8 bytes on Python 3.
    93             # are converted to utf-8 bytes on Python 3.
    94             paragraphs = [p.decode("utf-8") for p in message.split(b'\n\n')]
    94             paragraphs = [p.decode("utf-8") for p in message.split(b'\n\n')]
    95         # Be careful not to translate the empty string -- it holds the
    95         # Be careful not to translate the empty string -- it holds the