From 7651757709b2eaa537cbda17271b127ed59568cf Mon Sep 17 00:00:00 2001 From: ilovezfs Date: Wed, 30 Mar 2016 04:03:19 -0700 Subject: [PATCH] OS::Mac::sdk: remove ensure block Don't use ensure to do the final check because it won't affect the return value of the overall function. Thanks to @xucheng for catching this bug. Closes Homebrew/homebrew#50536. Signed-off-by: ilovezfs --- Library/Homebrew/os/mac.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index a9227d7909..096cfb24b1 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -100,10 +100,9 @@ module OS end rescue SDKLocator::NoSDKError sdk = @locator.latest_sdk - ensure - # only return an SDK older than the OS version if it was specifically requested - sdk if v || (!sdk.nil? && sdk.version >= version) end + # Only return an SDK older than the OS version if it was specifically requested + sdk if v || (!sdk.nil? && sdk.version >= version) end # Returns the path to an SDK or nil, following the rules set by #sdk.