Patchwork D3633: py3: use bytes in tests/printenv.py

login
register
mail settings
Submitter phabricator
Date May 21, 2018, 6:36 p.m.
Message ID <79ad6da062bf3d9ffd911a9a14745eda@localhost.localdomain>
Download mbox | patch
Permalink /patch/31785/
State Not Applicable
Headers show

Comments

phabricator - May 21, 2018, 6:36 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGbacbe829c2bf: py3: use bytes in tests/printenv.py (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3633?vs=8841&id=8858

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

AFFECTED FILES
  tests/printenv.py

CHANGE DETAILS




To: pulkit, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel

Patch

diff --git a/tests/printenv.py b/tests/printenv.py
--- a/tests/printenv.py
+++ b/tests/printenv.py
@@ -39,14 +39,15 @@ 
        if k.startswith("HG_") and v]
 env.sort()
 
-out.write("%s hook: " % name)
+out.write(b"%s hook: " % name.encode('ascii'))
 if os.name == 'nt':
     filter = lambda x: x.replace('\\', '/')
 else:
     filter = lambda x: x
-vars = ["%s=%s" % (k, filter(v)) for k, v in env]
-out.write(" ".join(vars))
-out.write("\n")
+vars = [b"%s=%s" % (k.encode('ascii'), filter(v).encode('ascii'))
+        for k, v in env]
+out.write(b" ".join(vars))
+out.write(b"\n")
 out.close()
 
 sys.exit(exitcode)