Formula#system: don't try to close a closed stream

The new formula debugger users continuations to jump back up the stack,
and thus anything that has the potential to be executed twice (i.e.
ensure blocks) needs to to be essentially idempotent.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-11-09 14:04:05 -06:00
parent 3bdce1a7fa
commit bba85b4bd9

View File

@ -552,7 +552,7 @@ protected
rescue ErrorDuringExecution => e rescue ErrorDuringExecution => e
raise BuildError.new(self, cmd, args, $?) raise BuildError.new(self, cmd, args, $?)
ensure ensure
f.close if f f.close if f and not f.closed?
removed_ENV_variables.each do |key, value| removed_ENV_variables.each do |key, value|
ENV[key] = value ENV[key] = value
end if removed_ENV_variables end if removed_ENV_variables