This repository has been archived by the owner. It is now read-only.
Browse files

PythonInstalled: set PYTHONPATH, not prepend

An issue could arise when brewing a formula that
has Python 2.x and 3.x support and 2.x is the system Python
but 3.x is a brewed one. The idea about prepending was that
user configured PYTHONPATH could be used in formulae.
Now, instead and if needed, inside the `python do` block
one can still append to PYTHONPATH.
  • Loading branch information...
1 parent 4e2dbef commit 6761ffb88d8c469d1a39053f4c1cda04cae71b4e @samueljohn samueljohn committed Aug 27, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 Library/Homebrew/python_helper.rb
@@ -60,9 +60,9 @@ def python_helper(options={:allowed_major_versions => [2, 3]}, &block)
# In order to install into the Cellar, the dir must exist and be in the
# PYTHONPATH. This will be executed in the context of the formula
# so that lib points to the HOMEBREW_PREFIX/Cellar/<formula>/<version>/lib
- puts "brew: Prepending to PYTHONPATH: #{py.site_packages}" if ARGV.verbose?
+ puts "brew: setting PYTHONPATH to: #{py.site_packages}" if ARGV.verbose?
mkdir_p py.site_packages
- ENV.prepend_path 'PYTHONPATH', py.site_packages
+ ENV['PYTHONPATH'] = py.site_packages
ENV['PYTHON'] = py.binary
ENV.prepend_path 'CMAKE_INCLUDE_PATH', py.incdir
ENV.prepend_path 'PKG_CONFIG_PATH', py.pkg_config_path if py.pkg_config_path

0 comments on commit 6761ffb

Please sign in to comment.