language/python: fix Rubocop warnings.

This commit is contained in:
Mike McQuaid 2016-09-10 10:38:35 +01:00
parent bde8d69d6e
commit 16be0f105e

View File

@ -187,14 +187,13 @@ module Language
# Robustify symlinks to survive python3 patch upgrades
@venv_root.find do |f|
next unless f.symlink?
if (rp = f.realpath.to_s).start_with? HOMEBREW_CELLAR
next unless (rp = f.realpath.to_s).start_with? HOMEBREW_CELLAR
python = rp.include?("python3") ? "python3" : "python"
new_target = rp.sub %r{#{HOMEBREW_CELLAR}/#{python}/[^/]+}, Formula[python].opt_prefix
f.unlink
f.make_symlink new_target
end
end
end
# Installs packages represented by `targets` into the virtualenv.
# @param targets [String, Pathname, Resource,