summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'error.c')
-rw-r--r--error.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/error.c b/error.c
index ffdd1a4ef1..7f9e582930 100644
--- a/error.c
+++ b/error.c
@@ -329,7 +329,13 @@ rb_warn_m(int argc, VALUE *argv, VALUE exc)
rb_io_puts(argc, argv, str);
RBASIC_SET_CLASS(str, rb_cString);
}
- rb_write_warning_str(str);
+ if (exc == rb_mWarning) {
+ rb_must_asciicompat(str);
+ rb_write_error_str(str);
+ }
+ else {
+ rb_write_warning_str(str);
+ }
}
return Qnil;
}