util: use pycompat.bytestr() instead of str()
authorAugie Fackler <augie@google.com>
Sun, 25 Feb 2018 22:06:53 -0500
changeset 36418 d26b0bedfaa4
parent 36417 199443c55463
child 36419 75c76cee1b1b
util: use pycompat.bytestr() instead of str() This fixes at least some environment variable prints for util.system() callers on Python 3. Yay! Differential Revision: https://phab.mercurial-scm.org/D2434
mercurial/util.py
--- a/mercurial/util.py	Wed Feb 21 22:47:47 2018 +0900
+++ b/mercurial/util.py	Sun Feb 25 22:06:53 2018 -0500
@@ -1188,7 +1188,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())