Patchwork [7,of,9,V2] py3: un-byteify strings around os.system() and os.devnull in contrib/perf

login
register
mail settings
Submitter Matt Harbison
Date Sept. 25, 2018, 2:25 a.m.
Message ID <84c805bcb52ebf4450f0.1537842340@Envy>
Download mbox | patch
Permalink /patch/35008/
State Accepted
Headers show

Comments

Matt Harbison - Sept. 25, 2018, 2:25 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1537576080 14400
#      Fri Sep 21 20:28:00 2018 -0400
# Node ID 84c805bcb52ebf4450f04a3aaf0e125ee0c72326
# Parent  3709e38b0d5b812e2f11f27f493e6f0e30def497
py3: un-byteify strings around os.system() and os.devnull in contrib/perf

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -921,11 +921,11 @@  def perfstartup(ui, repo, **opts):
     timer, fm = gettimer(ui, opts)
     cmd = sys.argv[0]
     def d():
-        if os.name != b'nt':
+        if os.name != r'nt':
             os.system(b"HGRCPATH= %s version -q > /dev/null" % cmd)
         else:
-            os.environ[b'HGRCPATH'] = b' '
-            os.system(b"%s version -q > NUL" % cmd)
+            os.environ[r'HGRCPATH'] = r' '
+            os.system(r"%s version -q > NUL" % cmd)
     timer(d)
     fm.end()
 
@@ -1059,7 +1059,7 @@  def perftemplating(ui, repo, testedtempl
                           hint=b"use 4.3 or later")
 
     nullui = ui.copy()
-    nullui.fout = open(os.devnull, b'wb')
+    nullui.fout = open(os.devnull, r'wb')
     nullui.disablepager()
     revs = opts.get(b'rev')
     if not revs: