Patchwork D8334: tests: pass str to matchoutput()

login
register
mail settings
Submitter phabricator
Date March 29, 2020, 1:40 a.m.
Message ID <differential-rev-PHID-DREV-c5ussf5xtzzc666nmof5-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/45925/
State Superseded
Headers show

Comments

phabricator - March 29, 2020, 1:40 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  It accepts a str, not bytes.
  
  This fixes a failure in test-hghave.t on Windows. Why it
  wasn't failing on Linux, I don't know. I suspect the Windows
  process code in Python doesn't accept bytes and the POSIX code
  does?

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/hghave.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel
phabricator - March 30, 2020, 6:37 p.m.
mharbison72 added a comment.
mharbison72 accepted this revision.


  > I suspect the Windows process code in Python doesn't accept bytes and the POSIX code does?
  
  That's definitely my experience, and the reason for `procutil.tonativestr()`.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8334/new/

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

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

Patch

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -335,7 +335,7 @@ 
 @check("rust", "Using the Rust extensions")
 def has_rust():
     """Check is the mercurial currently running is using some rust code"""
-    cmd = b'hg debuginstall --quiet 2>&1'
+    cmd = 'hg debuginstall --quiet 2>&1'
     match = br'checking module policy \(([^)]+)\)'
     policy = matchoutput(cmd, match)
     if not policy: