diff options
| -rw-r--r-- | src/error.c | 5 | ||||
| -rw-r--r-- | test/t/exception.rb | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/error.c b/src/error.c index 5efa438ff..93e90fc69 100644 --- a/src/error.c +++ b/src/error.c @@ -166,13 +166,10 @@ exc_inspect(mrb_state *mrb, mrb_value exc) else { const char *cname = mrb_obj_classname(mrb, exc); str = mrb_str_new_cstr(mrb, cname); - mrb_str_cat_lit(mrb, str, ": "); if (append_mesg) { + mrb_str_cat_lit(mrb, str, ": "); mrb_str_cat_str(mrb, str, mesg); } - else { - mrb_str_cat_cstr(mrb, str, cname); - } } return str; } diff --git a/test/t/exception.rb b/test/t/exception.rb index 2dc8f5487..9c8b36e44 100644 --- a/test/t/exception.rb +++ b/test/t/exception.rb @@ -353,7 +353,7 @@ assert('Exception 19') do end assert('Exception#inspect without message') do - assert_equal "Exception: Exception", Exception.new.inspect + assert_equal "Exception", Exception.new.inspect end assert('Exception#backtrace') do |
