Skip to content

Commit

Permalink
use bash-python startup, but prefer /usr/bin/python3 and include -E t…
Browse files Browse the repository at this point in the history
…o defend against PYTHONHOME/PYHONPATH
  • Loading branch information
marcmengel authored and greenc-FNAL committed Apr 25, 2024
1 parent eab91bc commit d52d103
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/spack
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
# See https://stackoverflow.com/a/47886254
""":"
# prefer SPACK_PYTHON environment variable, python3, python, then python2
SPACK_PREFERRED_PYTHONS="python3 python python2 /usr/libexec/platform-python"
SPACK_PREFERRED_PYTHONS="/usr/bin/python3 python3 python python2 /usr/libexec/platform-python"
for cmd in "${SPACK_PYTHON:-}" ${SPACK_PREFERRED_PYTHONS}; do
if command -v > /dev/null "$cmd"; then
export SPACK_PYTHON="$(command -v "$cmd")"
exec "${SPACK_PYTHON}" "$0" "$@"
exec "${SPACK_PYTHON}" -E "$0" "$@"
fi
done
Expand Down

0 comments on commit d52d103

Please sign in to comment.