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 2e60cd7 commit 9cf7276
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions open_spiel/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ ${PYBIN} --version

MYDIR="$(dirname "$(realpath "$0")")"

# This function is only run on Github Actions!
function check_install_python() {
# 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
rm -f /usr/local/bin/2to3-3.11
rm -f /usr/local/bin/idle3.11
rm -f /usr/local/bin/pydoc3.11
rm -f /usr/local/bin/2to3-${OS_PYTHON_VERSION}
rm -f /usr/local/bin/idle${OS_PYTHON_VERSION}
rm -f /usr/local/bin/pydoc${OS_PYTHON_VERSION}
rm -f /usr/local/bin/python${OS_PYTHON_VERSION}
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}"
Expand Down

0 comments on commit 9cf7276

Please sign in to comment.