From patchwork Tue Sep 25 02:25:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [7, of, 9, V2] py3: un-byteify strings around os.system() and os.devnull in contrib/perf From: Matt Harbison X-Patchwork-Id: 35008 Message-Id: <84c805bcb52ebf4450f0.1537842340@Envy> To: mercurial-devel@mercurial-scm.org Date: Mon, 24 Sep 2018 22:25:40 -0400 # HG changeset patch # User Matt Harbison # 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 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: