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.
This commit is contained in:
Tim D. Smith 2015-09-09 04:42:29 -07:00
parent 0357673f21
commit 5997812ed2

View File

@ -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