From 0572b710c3ef7f497fe272a20bddb5ad971dca3b Mon Sep 17 00:00:00 2001 From: Oleg Plakhotniuk Date: Wed, 18 Jun 2014 14:58:54 +0200 Subject: [PATCH] Fix call of pyflakes on Archlinux close #1404 --- tools/pyflakes.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/pyflakes.sh b/tools/pyflakes.sh index f9da835e..24e46c37 100755 --- a/tools/pyflakes.sh +++ b/tools/pyflakes.sh @@ -19,13 +19,20 @@ fi if [ -n "${FLAKE8}" ]; then exec ${FLAKE8} --select=E9,F *.py $PYFILES else + PYFLAKES="" + if which pyflakes >/dev/null 2>&1; then + PYFLAKES=pyflakes + fi + if which pyflakes-python2 >/dev/null 2>&1; then + PYFLAKES=pyflakes-python2 + fi # check for modern pyflakes - if pyflakes --version >/dev/null 2>&1; then - exec pyflakes $PYFILES + if ${PYFLAKES} --version >/dev/null 2>&1; then + exec ${PYFLAKES} $PYFILES else # hide error reported by mistake. # grep will return 0 only if it founds something, but our script # wants to return 0 when it founds nothing! - pyflakes $PYFILES | grep -v redefinition && exit 1 || exit 0 + ${PYFLAKES} $PYFILES | grep -v redefinition && exit 1 || exit 0 fi fi