зеркало из https://github.com/github/ruby.git
Suppress exception message in finalizer [Feature #17798]
This commit is contained in:
Родитель
fc4dd45d01
Коммит
377995035a
2
gc.c
2
gc.c
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче