aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/language/python.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/language/python.rb')
-rw-r--r--Library/Homebrew/language/python.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb
index 49e3d1a46..3908f4b8f 100644
--- a/Library/Homebrew/language/python.rb
+++ b/Library/Homebrew/language/python.rb
@@ -35,7 +35,7 @@ module Language
probe_file = homebrew_site_packages(version)/"homebrew-pth-probe.pth"
begin
probe_file.atomic_write("import site; site.homebrew_was_here = True")
- quiet_system python, "-c", "import site; assert(site.homebrew_was_here)"
+ with_homebrew_path { quiet_system python, "-c", "import site; assert(site.homebrew_was_here)" }
ensure
probe_file.unlink if probe_file.exist?
end
@@ -71,10 +71,6 @@ module Language
]
end
- def self.package_available?(python, module_name)
- quiet_system python, "-c", "import #{module_name}"
- end
-
# Mixin module for {Formula} adding virtualenv support features.
module Virtualenv
def self.included(base)
@@ -138,11 +134,11 @@ module Language
def virtualenv_install_with_resources(options = {})
python = options[:using]
if python.nil?
- wanted = %w[python python3].select { |py| needs_python?(py) }
+ wanted = %w[python python@2 python@3 python3].select { |py| needs_python?(py) }
raise FormulaAmbiguousPythonError, self if wanted.size > 1
- python = wanted.first || "python"
+ python = wanted.first || "python2.7"
end
- venv = virtualenv_create(libexec, python)
+ venv = virtualenv_create(libexec, python.delete("@"))
venv.pip_install resources
venv.pip_install_and_link buildpath
venv