Update exception message in string_for_symbol

This is a static function only called in two places (rb_to_id and
rb_to_symbol), and in both places, both symbols and strings are
allowed.  This makes the error message consistent with rb_check_id
and rb_check_symbol.

Fixes [Bug #20607]
This commit is contained in:
Jeremy Evans 2024-07-03 12:17:12 -07:00
parent 268c72377b
commit 8dc0d2904a
Notes: git 2024-09-19 04:29:23 +00:00
4 changed files with 9 additions and 9 deletions

View file

@ -12398,7 +12398,7 @@ string_for_symbol(VALUE name)
if (!RB_TYPE_P(name, T_STRING)) {
VALUE tmp = rb_check_string_type(name);
if (NIL_P(tmp)) {
rb_raise(rb_eTypeError, "%+"PRIsVALUE" is not a symbol",
rb_raise(rb_eTypeError, "%+"PRIsVALUE" is not a symbol nor a string",
name);
}
name = tmp;