From 98a2579a1707e46a27fdd2fbfcdb6a190cfb0fa7 Mon Sep 17 00:00:00 2001 From: Kyrylo Silin Date: Sun, 10 Mar 2019 01:53:00 +0200 Subject: [PATCH] Move Pry::DEFAULT_EXCEPTION_WHITELIST to Config --- lib/pry/config.rb | 5 ++++- lib/pry/exceptions.rb | 14 -------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/lib/pry/config.rb b/lib/pry/config.rb index 460c444f..7492fb5c 100644 --- a/lib/pry/config.rb +++ b/lib/pry/config.rb @@ -45,7 +45,10 @@ class Pry end end, - unrescued_exceptions: Pry::DEFAULT_UNRESCUED_EXCEPTIONS, + unrescued_exceptions: [ + ::SystemExit, ::SignalException, Pry::TooSafeException + ], + exception_whitelist: Pry.lazy do defaults.output.puts( '[warning] Pry.config.exception_whitelist is deprecated, ' \ diff --git a/lib/pry/exceptions.rb b/lib/pry/exceptions.rb index 92859f7b..603dd132 100644 --- a/lib/pry/exceptions.rb +++ b/lib/pry/exceptions.rb @@ -57,20 +57,6 @@ class Pry end end - # Don't catch these exceptions - DEFAULT_UNRESCUED_EXCEPTIONS = [SystemExit, - SignalException, - Pry::TooSafeException].freeze - DEFAULT_EXCEPTION_WHITELIST = DEFAULT_UNRESCUED_EXCEPTIONS - if Object.respond_to?(:deprecate_constant) - deprecate_constant :DEFAULT_EXCEPTION_WHITELIST - else - warn( - 'DEFAULT_EXCEPTION_WHITELIST is deprecated and will be removed in a ' \ - 'future version of Pry. Please use DEFAULT_UNRESCUED_EXCEPTIONS instead.' - ) - end - # CommandErrors are caught by the REPL loop and displayed to the user. They # indicate an exceptional condition that's fatal to the current command. class CommandError < StandardError; end