diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -609,14 +609,7 @@ def has_root(): @check("pyflakes", "Pyflakes python linter") def has_pyflakes(): - try: - import pyflakes - - pyflakes.__version__ - except ImportError: - return False - else: - return True + return matchoutput("pyflakes --version", br"^\d+\.\d+\.\d+\b", True) @check("pylint", "Pylint python linter") diff --git a/tests/test-check-pyflakes.t b/tests/test-check-pyflakes.t --- a/tests/test-check-pyflakes.t +++ b/tests/test-check-pyflakes.t @@ -8,7 +8,7 @@ run pyflakes on all tracked files ending $ cat > test.py < print(undefinedname) > EOF - $ "$PYTHON" -m pyflakes test.py 2>/dev/null | "$TESTDIR/filterpyflakes.py" + $ pyflakes test.py 2>/dev/null | "$TESTDIR/filterpyflakes.py" test.py:1:* undefined name 'undefinedname' (glob) $ cd "`dirname "$TESTDIR"`" @@ -18,7 +18,7 @@ run pyflakes on all tracked files ending > -X contrib/python-zstandard \ > -X mercurial/thirdparty \ > 2>/dev/null \ - > | xargs "$PYTHON" -m pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py" + > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py" contrib/perf.py:*:* undefined name 'xrange' (glob) (?) mercurial/pycompat.py:*:* 'codecs' imported but unused (glob) mercurial/pycompat.py:*:* 'concurrent.futures' imported but unused (glob)