Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

language/python: avoid modifying all Python symlinks #18128

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Library/Homebrew/language/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,9 @@
# Robustify symlinks to survive python patch upgrades
@venv_root.find do |f|
next unless f.symlink?
next unless (rp = f.realpath.to_s).start_with? HOMEBREW_CELLAR
next unless f.readlink.expand_path.to_s.start_with? HOMEBREW_CELLAR

rp = f.realpath.to_s

Check warning on line 335 in Library/Homebrew/language/python.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/language/python.rb#L335

Added line #L335 was not covered by tests
version = rp.match %r{^#{HOMEBREW_CELLAR}/python@(.*?)/}o
version = "@#{version.captures.first}" unless version.nil?

Expand Down