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

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Mon Feb 26 03:49:12 UTC 2018


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

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())



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


More information about the Mercurial-devel mailing list