From patchwork Wed Mar 29 19:51:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1,of,2,py3] color: replace str() with pycompat.bytestr() From: Pulkit Goyal <7895pulkit@gmail.com> X-Patchwork-Id: 19828 Message-Id: <7339bf21508131c90a44.1490817098@pulkit-goyal> To: mercurial-devel@mercurial-scm.org Date: Thu, 30 Mar 2017 01:21:38 +0530 # HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1490779072 -19800 # Wed Mar 29 14:47:52 2017 +0530 # Node ID 7339bf21508131c90a44317ff16214b81ebe62c1 # Parent 08aeba5bc7c623a700eea9011e0d904e3732134a color: replace str() with pycompat.bytestr() diff -r 08aeba5bc7c6 -r 7339bf215081 mercurial/color.py --- a/mercurial/color.py Sun Mar 26 20:52:51 2017 +0530 +++ b/mercurial/color.py Wed Mar 29 14:47:52 2017 +0530 @@ -332,9 +332,10 @@ stop = _effect_str(ui, 'none') else: activeeffects = _activeeffects(ui) - start = [str(activeeffects[e]) for e in ['none'] + effects.split()] + start = [pycompat.bytestr(activeeffects[e]) for e in ['none'] + + effects.split()] start = '\033[' + ';'.join(start) + 'm' - stop = '\033[' + str(activeeffects['none']) + 'm' + stop = '\033[' + pycompat.bytestr(activeeffects['none']) + 'm' return _mergeeffects(text, start, stop) _ansieffectre = re.compile(br'\x1b\[[0-9;]*m')