diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index a76740ef7c..f68df9d74e 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -552,7 +552,7 @@ protected rescue ErrorDuringExecution => e raise BuildError.new(self, cmd, args, $?) ensure - f.close if f + f.close if f and not f.closed? removed_ENV_variables.each do |key, value| ENV[key] = value end if removed_ENV_variables