aboutsummaryrefslogtreecommitdiffstats
path: root/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'error.c')
-rw-r--r--error.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/error.c b/error.c
index c0999f84c9..efa43f38ae 100644
--- a/error.c
+++ b/error.c
@@ -327,7 +327,7 @@ rb_exc_new3(etype, str)
VALUE etype, str;
{
StringValue(str);
- return rb_exc_new(etype, RSTRING(str)->ptr, RSTRING(str)->len);
+ return rb_funcall(etype, rb_intern("new"), 1, str);
}
/*
@@ -346,10 +346,7 @@ exc_initialize(argc, argv, exc)
{
VALUE arg;
- if (rb_scan_args(argc, argv, "01", &arg) == 1) {
- VALUE mesg = arg;
- StringValue(mesg); /* ensure mesg can be converted to String */
- }
+ rb_scan_args(argc, argv, "01", &arg);
rb_iv_set(exc, "mesg", arg);
rb_iv_set(exc, "bt", Qnil);