Stop failing sitecustomize if cellar not in path #18338

Closed
wants to merge 1 commit into
from
View
3 Library/Formula/python.rb
@@ -140,7 +140,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.