python_dependency: cleanup, fix satisfy.
Closes Homebrew/homebrew#26067.
This commit is contained in:
parent
a65f649cf5
commit
689be66203
@ -4,7 +4,7 @@ class PythonDependency < Requirement
|
|||||||
fatal true
|
fatal true
|
||||||
|
|
||||||
satisfy :build_env => false do
|
satisfy :build_env => false do
|
||||||
which python_binary
|
which 'python'
|
||||||
end
|
end
|
||||||
|
|
||||||
def modify_build_environment
|
def modify_build_environment
|
||||||
@ -13,30 +13,14 @@ class PythonDependency < Requirement
|
|||||||
|
|
||||||
# Deprecated
|
# Deprecated
|
||||||
def to_s
|
def to_s
|
||||||
python_binary
|
|
||||||
end
|
|
||||||
|
|
||||||
protected
|
|
||||||
|
|
||||||
def python_binary
|
|
||||||
'python'
|
'python'
|
||||||
end
|
end
|
||||||
|
|
||||||
def system_python?
|
|
||||||
which(python_binary).to_s == "/usr/bin/python"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
class Python3Dependency < PythonDependency
|
class Python3Dependency < PythonDependency
|
||||||
default_formula 'python3'
|
default_formula 'python3'
|
||||||
|
|
||||||
protected
|
satisfy :build_env => false do
|
||||||
|
which 'python3'
|
||||||
def python_binary
|
|
||||||
'python3'
|
|
||||||
end
|
|
||||||
|
|
||||||
def system_python?
|
|
||||||
false
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user