aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/requirements/python_requirement.rb
diff options
context:
space:
mode:
authorTim D. Smith2015-09-09 04:42:29 -0700
committerTim D. Smith2015-09-10 23:10:26 -0700
commit5997812ed23164cf3f52fe328ec665fe8cf70622 (patch)
tree2f7a6f1565fd69fea05292df85f2ac262c2f60a8 /Library/Homebrew/requirements/python_requirement.rb
parent0357673f213046b3bd29109be2e14c978e2aca3d (diff)
downloadbrew-5997812ed23164cf3f52fe328ec665fe8cf70622.tar.bz2
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.
Diffstat (limited to 'Library/Homebrew/requirements/python_requirement.rb')
-rw-r--r--Library/Homebrew/requirements/python_requirement.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/Library/Homebrew/requirements/python_requirement.rb b/Library/Homebrew/requirements/python_requirement.rb
index d4e4a116d..f41722782 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