diff options
-rw-r--r-- | gc.c | 2 | ||||
-rw-r--r-- | test/ruby/test_gc.rb | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -3990,7 +3990,7 @@ run_single_final(VALUE cmd, VALUE objid) static void warn_exception_in_finalizer(rb_execution_context_t *ec, VALUE final) { - if (final != Qundef) { + if (final != Qundef && !NIL_P(ruby_verbose)) { VALUE errinfo = ec->errinfo; rb_warn("Exception in finalizer %+"PRIsVALUE, final); rb_ec_error_print(ec, errinfo); diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index c3fc1047b6..4df9775ecc 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -459,7 +459,7 @@ class TestGc < Test::Unit::TestCase obj = nil } } - GC.start + EnvUtil.suppress_warning {GC.start} skip "finalizers did not get run" if result.empty? assert_equal([:c1, :c2], result) end @@ -482,7 +482,7 @@ class TestGc < Test::Unit::TestCase obj = nil } } - GC.start + EnvUtil.suppress_warning {GC.start} skip "finalizers did not get run" if @result.empty? assert_equal([:c1, :c2], @result) end |