# HG changeset patch # User Yuya Nishihara # Date 2017-09-03 06:42:27 # Node ID e9e225f1693295af54f54b86aa103fce8330d2ba # Parent d4d4d11bac77df890c5d5bf01827d59056993f06 doctest: pass encoding name as system string diff --git a/mercurial/encoding.py b/mercurial/encoding.py --- a/mercurial/encoding.py +++ b/mercurial/encoding.py @@ -268,7 +268,7 @@ def trim(s, width, ellipsis='', leftside >>> print trim(t, 1, ellipsis=ellipsis) + >>> u = u'\u3042\u3044\u3046\u3048\u304a' # 2 x 5 = 10 columns - >>> t = u.encode(encoding.encoding) + >>> t = u.encode(pycompat.sysstr(encoding.encoding)) >>> print trim(t, 12, ellipsis=ellipsis) \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a >>> print trim(t, 10, ellipsis=ellipsis)