Skip to content

Commit

Permalink
Update install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
lanctot authored Dec 5, 2024
1 parent f64a834 commit 54fba73
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion open_spiel/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ ${PYBIN} --version
MYDIR="$(dirname "$(realpath "$0")")"

function check_install_python() {
output=$(brew list --versions | grep "python ${OS_PYTHON_VERSION}")
# Need the trap here to make sure the return value of grep being 1 doesn't cause set -e to fail
# https://stackoverflow.com/questions/77047127/bash-capture-stderr-of-a-function-while-using-trap
trap 'ret=0; output=$(brew list --versions | grep "python ${OS_PYTHON_VERSION}") || ret="$?"; trap - RETURN' RETURN
if [[ "$output" = "" ]]; then
brew install "python@${OS_PYTHON_VERSION}"
fi
Expand Down

0 comments on commit 54fba73

Please sign in to comment.