From 4d5c1526665bda7ccd3948e388bec27001ddd1e7 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Thu, 5 Mar 2015 20:48:47 -0500 Subject: Remove unnecessary nil check The backticks will either return a string or raise an exception, so `executable` cannot be nil. --- Library/Homebrew/requirements/python_dependency.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/requirements/python_dependency.rb b/Library/Homebrew/requirements/python_dependency.rb index 750db6c53..f5276cb4e 100644 --- a/Library/Homebrew/requirements/python_dependency.rb +++ b/Library/Homebrew/requirements/python_dependency.rb @@ -36,9 +36,7 @@ class PythonDependency < Requirement def which_python python = which python_binary return unless python - executable = `#{python} -c "import sys; print(sys.executable)"`.strip - return unless executable - Pathname.new executable + Pathname.new Utils.popen_read(python, "-c", "import sys; print(sys.executable)").strip end def system_python; "/usr/bin/#{python_binary}" end -- cgit v1.2.3