summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'class.c')
-rw-r--r--class.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/class.c b/class.c
index 0f5dcd7..6f6c5d2 100644
--- a/class.c
+++ b/class.c
@@ -149,7 +149,7 @@ rb_define_class(name, super)
id = rb_intern(name);
if (rb_const_defined(rb_cObject, id)) {
klass = rb_const_get(rb_cObject, id);
- rb_raise(rb_eNameError, "%s is already defined", name);
+ rb_name_error(id, "%s is already defined", name);
}
klass = rb_define_class_id(id, super);
st_add_direct(rb_class_tbl, id, klass);
@@ -169,7 +169,7 @@ rb_define_class_under(outer, name, super)
id = rb_intern(name);
if (rb_const_defined_at(outer, id)) {
klass = rb_const_get(outer, id);
- rb_raise(rb_eNameError, "%s is already defined", name);
+ rb_name_error(id, "%s is already defined", name);
}
klass = rb_define_class_id(id, super);
rb_const_set(outer, id, klass);