summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/shared_helpers.rb7
-rw-r--r--lib/bundler/worker.rb2
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index 0d68c85831..086624b383 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -145,6 +145,13 @@ module Bundler
major_deprecation("Bundler will only support rubygems >= 2.0, you are running #{Bundler.rubygems.version}")
end
+ def trap(signal, override = false, &block)
+ prior = Signal.trap(signal) do
+ block.call
+ prior.call unless override
+ end
+ end
+
private
def find_gemfile
diff --git a/lib/bundler/worker.rb b/lib/bundler/worker.rb
index c6b96d815a..b73a7ed04a 100644
--- a/lib/bundler/worker.rb
+++ b/lib/bundler/worker.rb
@@ -27,7 +27,7 @@ module Bundler
@func = func
@size = size
@threads = nil
- trap("INT") { abort_threads }
+ SharedHelpers.trap("INT") { abort_threads }
end
# Enqueue a request to be executed in the worker pool