aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorTim D. Smith2015-10-17 10:05:41 -0700
committerTim D. Smith2015-11-08 11:58:28 -0800
commit55063f0ec749fdffc3dc72ea3f1651ea50e1a776 (patch)
tree174269158c6e825183e2738481e99ce45a42f348 /Library
parente4b4ad532f358d634b7b2582afe823f4f1f60c82 (diff)
downloadbrew-55063f0ec749fdffc3dc72ea3f1651ea50e1a776.tar.bz2
set up Python sys.path from install HOME
Necessary to allow system Python to find Python modules installed by Homebrew. Closes Homebrew/homebrew#45076. Fixes Homebrew/homebrew#43919. Probably fixes Homebrew/homebrew#44813.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index d0d1e269b..d055ad504 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -1273,7 +1273,7 @@ class Formula
mktemp do
@testpath = Pathname.pwd
ENV["HOME"] = @testpath
- setup_test_home @testpath
+ setup_home @testpath
test
end
ensure
@@ -1309,8 +1309,8 @@ class Formula
protected
- def setup_test_home(home)
- # keep Homebrew's site-packages in sys.path when testing with system Python
+ def setup_home(home)
+ # keep Homebrew's site-packages in sys.path when using system Python
user_site_packages = home/"Library/Python/2.7/lib/python/site-packages"
user_site_packages.mkpath
(user_site_packages/"homebrew.pth").write <<-EOS.undent
@@ -1470,6 +1470,7 @@ class Formula
mkdir_p env_home
old_home, ENV["HOME"] = ENV["HOME"], env_home
+ setup_home env_home
begin
yield