diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb index c41e22b5ce..903e1317d5 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -184,7 +184,7 @@ module Language @venv_root.find do |f| next unless f.symlink? next unless (rp = f.realpath.to_s).start_with? HOMEBREW_CELLAR - python = rp.include?("python2") ? "python2" : "python" + python = rp.include?("python@2") ? "python@2" : "python" new_target = rp.sub %r{#{HOMEBREW_CELLAR}/#{python}/[^/]+}, Formula[python].opt_prefix f.unlink f.make_symlink new_target @@ -192,7 +192,7 @@ module Language Pathname.glob(@venv_root/"lib/python*/orig-prefix.txt").each do |prefix_file| prefix_path = prefix_file.read - python = prefix_path.include?("python2") ? "python2" : "python" + python = prefix_path.include?("python@2") ? "python@2" : "python" prefix_path.sub! %r{^#{HOMEBREW_CELLAR}/#{python}/[^/]+}, Formula[python].opt_prefix prefix_file.atomic_write prefix_path end