language/python: raise if we can't detect the Python to use for venv

This commit is contained in:
Bo Anderson
2020-07-09 15:43:36 +01:00
parent f01d264c3c
commit 1c73393b47
2 changed files with 13 additions and 0 deletions
+1
View File
@@ -182,6 +182,7 @@ module Language
if python.nil?
pythons = %w[python python3 python@3 python@3.7 python@3.8 pypy pypy3]
wanted = pythons.select { |py| needs_python?(py) }
raise FormulaUnknownPythonError, self if wanted.empty?
raise FormulaAmbiguousPythonError, self if wanted.size > 1
python = wanted.first