diff options
-rw-r--r-- | test/ruby/envutil.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb index 6409872ba4..93f054724f 100644 --- a/test/ruby/envutil.rb +++ b/test/ruby/envutil.rb @@ -345,8 +345,10 @@ eom ignore_stderr = nil end if res - res.backtrace.each do |l| - l.sub!(/\A-:(\d+)/){"#{file}:#{line + $1.to_i}"} + if bt = res.backtrace + bt.each do |l| + l.sub!(/\A-:(\d+)/){"#{file}:#{line + $1.to_i}"} + end end raise res end |