diff options
| author | Jack Nagel | 2014-03-31 01:01:58 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-03-31 01:01:58 -0500 |
| commit | 6f224504b4b60429525f92606b7fe9056e967dae (patch) | |
| tree | 9eb8c3c03dd179ad5e40d59f28dc32837514c7cf /Library/Formula/python.rb | |
| parent | 3a70c03132d7182acb60040f4e7d11f37c53e68b (diff) | |
| download | homebrew-6f224504b4b60429525f92606b7fe9056e967dae.tar.bz2 | |
python: fix sitecustomize.py
Fixes #26377.
Fixes #28001.
Diffstat (limited to 'Library/Formula/python.rb')
| -rw-r--r-- | Library/Formula/python.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Formula/python.rb b/Library/Formula/python.rb index f8a392aec..8bac3ae29 100644 --- a/Library/Formula/python.rb +++ b/Library/Formula/python.rb @@ -243,8 +243,8 @@ class Python < Formula ' You should `unset PYTHONPATH` to fix this.') else: # Only do this for a brewed python: - opt_executable = '#{HOMEBREW_PREFIX}/opt/python/bin/python2.7' - if os.path.realpath(sys.executable) == os.path.realpath(opt_executable): + opt_executable = '#{opt_bin}/python2.7' + if os.path.commonprefix([os.path.realpath(e) for e in [opt_executable, sys.executable]]).startswith('#{rack}'): # Remove /System site-packages, and the Cellar site-packages # which we moved to lib/pythonX.Y/site-packages. Further, remove # HOMEBREW_PREFIX/lib/python because we later addsitedir(...). @@ -260,7 +260,7 @@ class Python < Formula # Assume Framework style build (default since months in brew) try: from _sysconfigdata import build_time_vars - build_time_vars['LINKFORSHARED'] = '-u _PyMac_Error #{HOMEBREW_PREFIX}/opt/python/Frameworks/Python.framework/Versions/2.7/Python' + build_time_vars['LINKFORSHARED'] = '-u _PyMac_Error #{opt_prefix}/Frameworks/Python.framework/Versions/2.7/Python' except: pass # remember: don't print here. Better to fail silently. |
