mercurial/i18n.py
changeset 51288 8b2ea2246a5f
parent 51287 f15cb5111a1e
child 51290 f4a0806081f2
equal deleted inserted replaced
51287:f15cb5111a1e 51288:8b2ea2246a5f
    87 
    87 
    88     cache = _msgcache.setdefault(encoding.encoding, {})
    88     cache = _msgcache.setdefault(encoding.encoding, {})
    89     if message not in cache:
    89     if message not in cache:
    90         if type(message) is str:
    90         if type(message) is str:
    91             # goofy unicode docstrings in test
    91             # goofy unicode docstrings in test
    92             paragraphs = message.split(u'\n\n')  # type: List[str]
    92             paragraphs: List[str] = message.split(u'\n\n')
    93         else:
    93         else:
    94             # should be ascii, but we have unicode docstrings in test, which
    94             # should be ascii, but we have unicode docstrings in test, which
    95             # are converted to utf-8 bytes on Python 3.
    95             # are converted to utf-8 bytes on Python 3.
    96             paragraphs = [p.decode("utf-8") for p in message.split(b'\n\n')]
    96             paragraphs = [p.decode("utf-8") for p in message.split(b'\n\n')]
    97         # Be careful not to translate the empty string -- it holds the
    97         # Be careful not to translate the empty string -- it holds the