Project

General

Profile

Bug #14247 ยป 0001-Fix-KeyError-key-receiver-of-Thread-fetch.patch

znz (Kazuhiro NISHIYAMA), 12/27/2017 01:54 PM

View differences:

test/ruby/test_thread.rb
557 557
    assert_equal(3, t.fetch("qux") {x = 3})
558 558
    assert_equal(3, x)
559 559

  
560
    assert_raise(KeyError) {t.fetch(:qux)}
560
    e = assert_raise(KeyError) {t.fetch(:qux)}
561
    assert_equal(:qux, e.key)
562
    assert_equal(t, e.receiver)
561 563
  ensure
562 564
    t.kill if t
563 565
  end
thread.c
3168 3168
	return rb_yield(key);
3169 3169
    }
3170 3170
    else if (argc == 1) {
3171
	rb_raise(rb_eKeyError, "key not found: %"PRIsVALUE, key);
3171
	rb_key_err_raise(rb_sprintf("key not found: %+"PRIsVALUE, key), self, key);
3172 3172
    }
3173 3173
    else {
3174 3174
	return argv[1];
3175
-