ruby-changes:49467
From: naruse <ko1@a...>
Date: Thu, 4 Jan 2018 03:15:02 +0900 (JST)
Subject: [ruby-changes:49467] naruse:r61583 (ruby_2_5): merge revision(s) 61507: [Backport #14247]
naruse 2018-01-04 03:14:56 +0900 (Thu, 04 Jan 2018) New Revision: 61583 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61583 Log: merge revision(s) 61507: [Backport #14247] Fix KeyError#{key,receiver} of Thread#fetch [ruby-core:84508] [Bug #14247] Modified directories: branches/ruby_2_5/ Modified files: branches/ruby_2_5/test/ruby/test_thread.rb branches/ruby_2_5/thread.c branches/ruby_2_5/version.h Index: ruby_2_5/version.h =================================================================== --- ruby_2_5/version.h (revision 61582) +++ ruby_2_5/version.h (revision 61583) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_5/version.h#L1 #define RUBY_VERSION "2.5.0" #define RUBY_RELEASE_DATE "2018-01-04" -#define RUBY_PATCHLEVEL 5 +#define RUBY_PATCHLEVEL 6 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 1 Index: ruby_2_5/test/ruby/test_thread.rb =================================================================== --- ruby_2_5/test/ruby/test_thread.rb (revision 61582) +++ ruby_2_5/test/ruby/test_thread.rb (revision 61583) @@ -557,7 +557,9 @@ class TestThread < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_5/test/ruby/test_thread.rb#L557 assert_equal(3, t.fetch("qux") {x = 3}) assert_equal(3, x) - assert_raise(KeyError) {t.fetch(:qux)} + e = assert_raise(KeyError) {t.fetch(:qux)} + assert_equal(:qux, e.key) + assert_equal(t, e.receiver) ensure t.kill if t end Index: ruby_2_5/thread.c =================================================================== --- ruby_2_5/thread.c (revision 61582) +++ ruby_2_5/thread.c (revision 61583) @@ -3168,7 +3168,7 @@ rb_thread_fetch(int argc, VALUE *argv, V https://github.com/ruby/ruby/blob/trunk/ruby_2_5/thread.c#L3168 return rb_yield(key); } else if (argc == 1) { - rb_raise(rb_eKeyError, "key not found: %"PRIsVALUE, key); + rb_key_err_raise(rb_sprintf("key not found: %+"PRIsVALUE, key), self, key); } else { return argv[1]; Index: ruby_2_5 =================================================================== --- ruby_2_5 (revision 61582) +++ ruby_2_5 (revision 61583) Property changes on: ruby_2_5 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r61507 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/