diff --git a/lib/spring/application.rb b/lib/spring/application.rb index d713e82e..c460b77b 100644 --- a/lib/spring/application.rb +++ b/lib/spring/application.rb @@ -320,6 +320,7 @@ def shush_backtraces if $! lib = File.expand_path("..", __FILE__) $!.backtrace.reject! { |line| line.start_with?(lib) } unless $!.backtrace.frozen? + $!.backtrace_locations.reject! { |line| line.path&.start_with?(lib) } unless $!.backtrace_locations.frozen? end end end @@ -331,6 +332,7 @@ def shush_backtraces if $! lib = File.expand_path("..", __FILE__) $!.backtrace.reject! { |line| line.start_with?(lib) } unless $!.backtrace.frozen? + $!.backtrace_locations.reject! { |line| line.path&.start_with?(lib) } unless $!.backtrace_locations.frozen? end end end