py3: un-byteify strings around os.system() and os.devnull in contrib/perf
authorMatt Harbison <matt_harbison@yahoo.com>
Fri, 21 Sep 2018 20:28:00 -0400
changeset 39824 db875f97a969
parent 39823 c4ab9fa81377
child 39825 874712506b07
py3: un-byteify strings around os.system() and os.devnull in contrib/perf
contrib/perf.py
--- a/contrib/perf.py	Fri Sep 21 20:16:13 2018 -0400
+++ b/contrib/perf.py	Fri Sep 21 20:28:00 2018 -0400
@@ -921,11 +921,11 @@
     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 @@
                           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: