Skip to content

Commit c017c7e

Browse files
committed
download_queue: restore Interrupt handling
178580a changed `rescue Interrupt` to plain `rescue` but this actually excludes `Interrupt` exceptions, which means that pressing Ctrl-C during a download would leave the terminal in a broken state. To see the problem, one can try e.g. `brew fetch --deps qt` and then press Ctrl-C immediately once the downloads start.
1 parent 23d4a36 commit c017c7e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Library/Homebrew/download_queue.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ def fetch
156156
end
157157

158158
sleep 0.05
159-
rescue
159+
# We want to catch all exceptions to ensure we can cancel any
160+
# running downloads and flush the TTY.
161+
rescue Exception # rubocop:disable Lint/RescueException
160162
remaining_downloads.each do |_, future|
161163
# FIXME: Implement cancellation of running downloads.
162164
end

0 commit comments

Comments
 (0)