tests/hghave.py
changeset 44498 aa0e1341457b
parent 44483 2e464925f662
child 44640 51ffb2a6c08a
--- a/tests/hghave.py	Thu Feb 27 22:34:45 2020 +0100
+++ b/tests/hghave.py	Wed Mar 11 05:41:02 2020 +0100
@@ -574,11 +574,14 @@
 
 @check("pyflakes", "Pyflakes python linter")
 def has_pyflakes():
-    return matchoutput(
-        "sh -c \"echo 'import re' 2>&1 | $PYTHON -m pyflakes\"",
-        br"<stdin>:1: 're' imported but unused",
-        True,
-    )
+    try:
+        import pyflakes
+
+        pyflakes.__version__
+    except ImportError:
+        return False
+    else:
+        return True
 
 
 @check("pylint", "Pylint python linter")