# HG changeset patch # User Yuya Nishihara # Date 1519904317 18000 # Node ID b2e54b257832565869ac8988569790826172b3a2 # Parent 7af7443877daad61d66222085c594e05d803d04a templatefilters: use encoding.unifromlocal/unitolocal() for py3 compatibility diff -r 7af7443877da -r b2e54b257832 mercurial/templatefilters.py --- a/mercurial/templatefilters.py Fri Mar 02 00:00:41 2018 +0530 +++ b/mercurial/templatefilters.py Thu Mar 01 06:38:37 2018 -0500 @@ -152,12 +152,12 @@ while True: m = para_re.search(text, start) if not m: - uctext = unicode(text[start:], encoding.encoding) + uctext = encoding.unifromlocal(text[start:]) w = len(uctext) while 0 < w and uctext[w - 1].isspace(): w -= 1 - yield (uctext[:w].encode(encoding.encoding), - uctext[w:].encode(encoding.encoding)) + yield (encoding.unitolocal(uctext[:w]), + encoding.unitolocal(uctext[w:])) break yield text[start:m.start(0)], m.group(1) start = m.end(1)