From c64fb9150e7ca0310637f8dd716e808af1997e6f Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Wed, 19 Dec 2012 15:12:18 +0100 Subject: [PATCH] Support systems with flake8 for python3 by default --- tools/pyflakes.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/pyflakes.sh b/tools/pyflakes.sh index 5340167d..3ca18d5f 100755 --- a/tools/pyflakes.sh +++ b/tools/pyflakes.sh @@ -2,9 +2,17 @@ cd $(dirname $0) cd .. +FLAKE8="" if which flake8 >/dev/null 2>&1; then + FLAKE8=flake8 +fi +if which flake8-python2 >/dev/null 2>&1; then + FLAKE8=flake8-python2 +fi + +if [ -n "${FLAKE8}" ]; then set -e - flake8 --ignore=E,W *.py weboob modules contrib scripts/* + ${FLAKE8} --ignore=E,W *.py weboob modules contrib scripts/* else # grep will return 0 only if it founds something, but our script # wants to return 0 when it founds nothing!