From 4fb7626ce55edd2db910781298c770cd49c1302b Mon Sep 17 00:00:00 2001 From: ilovezfs Date: Thu, 20 Jul 2017 02:54:04 -0700 Subject: [PATCH] python_requirement: prefer Homebrew's Python This avoids linkage to both system Python and Homebrew's python. --- Library/Homebrew/requirements/python_requirement.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/requirements/python_requirement.rb b/Library/Homebrew/requirements/python_requirement.rb index a4d34c8393..c162b072c9 100644 --- a/Library/Homebrew/requirements/python_requirement.rb +++ b/Library/Homebrew/requirements/python_requirement.rb @@ -18,12 +18,12 @@ class PythonRequirement < Requirement if !system_python? && short_version == Version.create("2.7") ENV.prepend_path "PATH", which_python.dirname - # Homebrew Python should take precedence over older Pythons in the PATH - elsif short_version != Version.create("2.7") - ENV.prepend_path "PATH", Formula["python"].opt_bin - ENV.prepend_path "PATH", Formula["python"].opt_libexec/"bin" end + # Homebrew Python should take precedence over other Pythons in the PATH + ENV.prepend_path "PATH", Formula["python"].opt_bin + ENV.prepend_path "PATH", Formula["python"].opt_libexec/"bin" + ENV["PYTHONPATH"] = "#{HOMEBREW_PREFIX}/lib/python#{short_version}/site-packages" end