tests/hghave.py
changeset 44498 aa0e1341457b
parent 44483 2e464925f662
child 44640 51ffb2a6c08a
equal deleted inserted replaced
44497:3265c92f7d13 44498:aa0e1341457b
   572     return getattr(os, 'geteuid', None) and os.geteuid() == 0
   572     return getattr(os, 'geteuid', None) and os.geteuid() == 0
   573 
   573 
   574 
   574 
   575 @check("pyflakes", "Pyflakes python linter")
   575 @check("pyflakes", "Pyflakes python linter")
   576 def has_pyflakes():
   576 def has_pyflakes():
   577     return matchoutput(
   577     try:
   578         "sh -c \"echo 'import re' 2>&1 | $PYTHON -m pyflakes\"",
   578         import pyflakes
   579         br"<stdin>:1: 're' imported but unused",
   579 
   580         True,
   580         pyflakes.__version__
   581     )
   581     except ImportError:
       
   582         return False
       
   583     else:
       
   584         return True
   582 
   585 
   583 
   586 
   584 @check("pylint", "Pylint python linter")
   587 @check("pylint", "Pylint python linter")
   585 def has_pylint():
   588 def has_pylint():
   586     return matchoutput("pylint --help", br"Usage:  pylint", True)
   589     return matchoutput("pylint --help", br"Usage:  pylint", True)