diff --git a/Library/Homebrew/requirements/python_dependency.rb b/Library/Homebrew/requirements/python_dependency.rb index 750db6c53c..f5276cb4e3 100644 --- a/Library/Homebrew/requirements/python_dependency.rb +++ b/Library/Homebrew/requirements/python_dependency.rb @@ -36,9 +36,7 @@ class PythonDependency < Requirement def which_python python = which python_binary return unless python - executable = `#{python} -c "import sys; print(sys.executable)"`.strip - return unless executable - Pathname.new executable + Pathname.new Utils.popen_read(python, "-c", "import sys; print(sys.executable)").strip end def system_python; "/usr/bin/#{python_binary}" end