Mercurial > public > mercurial-scm > hg-stable
diff hgext/show.py @ 31820:45761ef1bc93
py3: have registrar process docstrings in bytes
Mixing bytes and unicode creates a mess. Do things in bytes as possible.
New sysbytes() helper only takes care of ASCII characters, but avoids raising
nasty unicode exception. This is the same design principle as sysstr().
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 05 Apr 2017 00:34:58 +0900 |
parents | 264baeef3588 |
children | ad366d57d574 |
line wrap: on
line diff
--- a/hgext/show.py Tue Apr 04 16:49:12 2017 +0200 +++ b/hgext/show.py Wed Apr 05 00:34:58 2017 +0900 @@ -19,6 +19,7 @@ cmdutil, commands, error, + pycompat, registrar, ) @@ -133,5 +134,5 @@ # TODO make this more robust. longest = max(map(len, showview._table.keys())) for key in sorted(showview._table.keys()): - cmdtable['show'][0].__doc__ += ' %s %s\n' % ( - key.ljust(longest), showview._table[key]._origdoc) + cmdtable['show'][0].__doc__ += pycompat.sysstr(' %s %s\n' % ( + key.ljust(longest), showview._table[key]._origdoc))