diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index c2d6b169..09800c06 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -134,7 +134,11 @@ can_use_homebrew() { is_mac && command -v brew &>/dev/null && return 0 # In Linux, if Pyenv itself is installed with Homebrew, # we assume the user wants to take dependencies from there as well by default - command -v brew &>/dev/null && [[ $(abs_dirname "${BASH_SOURCE}") == "$(abs_dirname "$(brew --prefix)")"/* ]] && + local brew_prefix + command -v brew &>/dev/null && \ + # tests can have non-functional `brew' stub aliased to `false' + brew_prefix="$(brew --prefix)" && + [[ $(abs_dirname "${BASH_SOURCE}") == "$(abs_dirname "${brew_prefix}")"/* ]] && { lock_in homebrew; return 0; } # do not check the same stuff multiple times