mxcl/homebrew — pull request #24581 by minrk (2013-11-22 05:38:44+00:00)
Title: safer check for sys.executable in sitecustomize.py

make sure setting the value doesn't actually point to a different Python.

since sitecustomize.py is put in a location found by pypy, it breaks pypy by setting sys.executable to a path that is definitely wrong, and may not even exist.

I don't know how I came to have this file on my system - I don't recall having done `brew install python`, but I presume I did at some point. I certainly don't have brew python now.

The result is that `brew install pypy` fails with:

==> /usr/local/Cellar/pypy/2.2.0/libexec/bin/pypy setup.py install
running install
Checking .pth file support in /usr/local/Cellar/pypy/2.2.0/libexec/site-packages/
/usr/local/opt/python/bin/python2.7 -E -c pass
unable to execute /usr/local/opt/python/bin/python2.7: No such file or directory
error: command '/usr/local/opt/python/bin/python2.7' failed with exit status 1
/usr/local/Library/Homebrew/formula.rb:613:in `system'

because `sys.executable` has been set to a file that doesn't exist.