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:
parent
0357673f21
commit
5997812ed2
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user