Permalink
Browse files

python: sitecustomize checks path before remove

This fixes issues when calling python scripts print `'import sitecustomize' failed; use -v for traceback`

Closes #18338.

Signed-off-by: Samuel John <github@SamuelJohn.de>
  • Loading branch information...
1 parent 56d86e0 commit 10ba101c323f98118b427f291e15abc5b3732991 @deiga deiga committed with samueljohn Mar 8, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 Library/Formula/python.rb
@@ -138,7 +138,8 @@ def install
# Fix 2)
# Remove brewed Python's hard-coded site-packages
- sys.path.remove('#{site_packages_cellar}')
+ if '#{site_packages_cellar}' in sys.path:
+ sys.path.remove('#{site_packages_cellar}')
# Fix 3)
# For all Pythons: Tell about homebrew's site-packages location.

0 comments on commit 10ba101

Please sign in to comment.