Merge pull request #15969 from glensc/patch-1

Fix python: detected_python_shebang python pattern
This commit is contained in:
Mike McQuaid 2023-09-05 21:06:45 -04:00 committed by GitHub
commit 43295b2637
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,7 +115,7 @@ module Language
python_path = if use_python_from_path python_path = if use_python_from_path
"/usr/bin/env python3" "/usr/bin/env python3"
else else
python_deps = formula.deps.map(&:name).grep(/^python(@.*)?$/) python_deps = formula.deps.map(&:name).grep(/^python(@.+)?$/)
raise ShebangDetectionError.new("Python", "formula does not depend on Python") if python_deps.empty? raise ShebangDetectionError.new("Python", "formula does not depend on Python") if python_deps.empty?
if python_deps.length > 1 if python_deps.length > 1
raise ShebangDetectionError.new("Python", "formula has multiple Python dependencies") raise ShebangDetectionError.new("Python", "formula has multiple Python dependencies")