From 5997812ed23164cf3f52fe328ec665fe8cf70622 Mon Sep 17 00:00:00 2001 From: "Tim D. Smith" Date: Wed, 9 Sep 2015 04:42:29 -0700 Subject: [PATCH] Revert "python_requirement: fix ENV for python3" This reverts commit 85271644b0083cbc0fd6fea71120d1ad859fbc2a. Alex noticed that setting PYTHONPATH causes weirdness if we depend_on something which may be optionally built --with-python3; PYTHONPATH unexpectedly contains python3 modules in the depending formula if the formula upon which it depends was built --with-python3 even though the depending formula may only use python2. Closes Homebrew/homebrew#43724. Closes Homebrew/homebrew#43744. --- Library/Homebrew/requirements/python_requirement.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/requirements/python_requirement.rb b/Library/Homebrew/requirements/python_requirement.rb index d4e4a116d6..f41722782f 100644 --- a/Library/Homebrew/requirements/python_requirement.rb +++ b/Library/Homebrew/requirements/python_requirement.rb @@ -24,7 +24,9 @@ class PythonRequirement < Requirement ENV.prepend_path "PATH", Formula["python"].opt_bin end - ENV["PYTHONPATH"] = "#{HOMEBREW_PREFIX}/lib/python#{short_version}/site-packages" + if python_binary == "python" + ENV["PYTHONPATH"] = "#{HOMEBREW_PREFIX}/lib/python#{short_version}/site-packages" + end end def python_short_version @@ -60,10 +62,6 @@ class Python3Requirement < PythonRequirement satisfy(:build_env => false) { which_python } - env do - ENV["PYTHONPATH"] = "#{HOMEBREW_PREFIX}/lib/python#{python_short_version}/site-packages" - end - def python_binary "python3" end