Patchwork D2434: util: use pycompat.bytestr() instead of str()

login
register
mail settings
Submitter phabricator
Date Feb. 26, 2018, 3:49 a.m.
Message ID <differential-rev-PHID-DREV-z2cj2ryyeysqaoqxbrvp-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28359/
State Superseded
Headers show

Comments

phabricator - Feb. 26, 2018, 3:49 a.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This fixes at least some environment variable prints for util.system()
  callers on Python 3. Yay!

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2434

AFFECTED FILES
  mercurial/util.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1187,7 +1187,7 @@ 
             return '0'
         if val is True:
             return '1'
-        return str(val)
+        return pycompat.bytestr(val)
     env = dict(encoding.environ)
     if environ:
         env.update((k, py2shell(v)) for k, v in environ.iteritems())