From 4738b96d753957ebe65d3e9b7091ee9ed4ba98d9 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 19 Jan 2021 21:45:32 +0100 Subject: [PATCH] Use $PYTHON when running mypy Make sure to run mypy with the desired Python version. Signed-off-by: Gilles Peskine --- tests/scripts/check-python-files.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/scripts/check-python-files.sh b/tests/scripts/check-python-files.sh index 322e92b505..5796c29b60 100755 --- a/tests/scripts/check-python-files.sh +++ b/tests/scripts/check-python-files.sh @@ -53,7 +53,7 @@ can_mypy () { # minimum version is required. The check is not just "type mypy" # because that passes if a mypy exists but is not installed for the current # python version. - mypy --version 2>/dev/null >/dev/null + $PYTHON -m mypy --version 2>/dev/null >/dev/null } # With just a --can-xxx option, check whether the tool for xxx is available @@ -77,7 +77,7 @@ $PYTHON -m pylint -j 2 scripts/mbedtls_dev/*.py scripts/*.py tests/scripts/*.py if can_mypy; then echo echo 'Running mypy ...' - mypy scripts/*.py tests/scripts/*.py || + $PYTHON -m mypy scripts/*.py tests/scripts/*.py || ret=1 fi