aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/doctor.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 76f35bb12..9ab3c46f8 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -890,8 +890,10 @@ end
def check_for_bad_python_symlink
return unless which "python"
- # Indeed Python --version outputs to stderr (WTF?)
- `python --version 2>&1` =~ /Python (\d+)\./
+ # Indeed Python -V outputs to stderr (WTF?)
+ `python -V 2>&1` =~ /Python (\d+)\./
+ # This won't be the right warning if we matched nothing at all
+ return if $1.nil?
unless $1 == "2" then <<-EOS.undent
python is symlinked to python#$1
This will confuse build scripts and in general lead to subtle breakage.