pytype: only try the hacky way of finding PYTHON if not provided
authorRaphaël Gomès <rgomes@octobus.net>
Tue, 23 Jul 2024 12:10:31 +0200
changeset 51711 832a1aeb576f
parent 51710 8fe7c0e1df1e
child 51712 e153995011b7
pytype: only try the hacky way of finding PYTHON if not provided This allows us to work in more environments, like when using pyenv. This syntax is compatible with all POSIX shells.
contrib/setup-pytype.sh
--- a/contrib/setup-pytype.sh	Mon Jul 22 14:42:54 2024 +0200
+++ b/contrib/setup-pytype.sh	Tue Jul 23 12:10:31 2024 +0200
@@ -5,7 +5,7 @@
 
 # Find the python3 setup that would run pytype
 PYTYPE=`which pytype`
-PYTHON3=`head -n1 ${PYTYPE} | sed -s 's/#!//'`
+PYTHON3=${PYTHON:-`head -n1 ${PYTYPE} | sed -s 's/#!//'`}
 
 # Existing stubs that pytype processes live here
 TYPESHED=$(${PYTHON3} -c "import pytype; print(pytype.__path__[0])")/typeshed/stubs