aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/system_config.rb
diff options
context:
space:
mode:
authorMike McQuaid2017-07-21 17:31:35 +0100
committerMike McQuaid2017-07-21 17:31:35 +0100
commitacb418c4881a2f9c9cef96ad3ee4063134d1b63b (patch)
tree5610cc7c76ea19211bd5781b334c24aa627e0ff8 /Library/Homebrew/system_config.rb
parent9747bc397a43f082aaaec24d4583ec465349eead (diff)
downloadbrew-acb418c4881a2f9c9cef96ad3ee4063134d1b63b.tar.bz2
system_config: look for python formula binary.
Now that Python has been renamed it's important that we still output which Python they are using for debugging purposes e.g. ``` Python: /usr/local/opt/python/libexec/bin/python => /usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/bin/python2.7 ```
Diffstat (limited to 'Library/Homebrew/system_config.rb')
-rw-r--r--Library/Homebrew/system_config.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/Library/Homebrew/system_config.rb b/Library/Homebrew/system_config.rb
index f89c79306..5663295c2 100644
--- a/Library/Homebrew/system_config.rb
+++ b/Library/Homebrew/system_config.rb
@@ -77,7 +77,14 @@ class SystemConfig
end
def describe_python
- python = which "python"
+ python = begin
+ python_path = PATH.new(ENV["HOMEBREW_PATH"])
+ .prepend(Formula["python"].opt_libexec/"bin")
+ which "python", python_path
+ rescue FormulaUnavailableError
+ which "python"
+ end
+
return "N/A" if python.nil?
python_binary = Utils.popen_read python, "-c", "import sys; sys.stdout.write(sys.executable)"
python_binary = Pathname.new(python_binary).realpath