D7219: hghave: decode black's version before passing to StrictVersion

Kwan (Ian Moody) phabricator at mercurial-scm.org
Mon Nov 4 19:12:31 UTC 2019


Kwan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  StrictVersion doesn't accept bytes, so test-hghave.t was dying with
  "cannot use a string pattern on a bytes-like object".

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  tests/hghave.py

CHANGE DETAILS

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -987,4 +987,4 @@
     version_regex = b'black, version ([0-9a-b.]+)'
     version = matchoutput(blackcmd, version_regex)
     sv = distutils.version.StrictVersion
-    return version and sv(version.group(1)) >= sv('19.10b0')
+    return version and sv(version.group(1).decode()) >= sv('19.10b0')



To: Kwan, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list