aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/requirements/python_dependency.rb
diff options
context:
space:
mode:
authorJack Nagel2015-03-05 20:48:47 -0500
committerJack Nagel2015-03-05 20:48:47 -0500
commit493edcf1f7f9a5e6810233ffcbd50c1c0d1823f3 (patch)
tree9b854cffe67e67704ac3858889e1b370eeb8bae4 /Library/Homebrew/requirements/python_dependency.rb
parenta60f0d58ce77a6b87424f084e6d0f8d7a9b1560c (diff)
downloadhomebrew-493edcf1f7f9a5e6810233ffcbd50c1c0d1823f3.tar.bz2
Remove unnecessary nil check
The backticks will either return a string or raise an exception, so `executable` cannot be nil.
Diffstat (limited to 'Library/Homebrew/requirements/python_dependency.rb')
-rw-r--r--Library/Homebrew/requirements/python_dependency.rb4
1 files changed, 1 insertions, 3 deletions
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