summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/io.c b/io.c
index 4350a9acab..b2acba401a 100644
--- a/io.c
+++ b/io.c
@@ -1172,11 +1172,7 @@ static VALUE
io_get_io(io)
VALUE io;
{
- if (TYPE(io) != T_FILE) {
- io = rb_funcall(io, rb_intern("to_io"), 0, 0);
- Check_Type(io, T_FILE);
- }
- return io;
+ return rb_convert_type(io, T_FILE, "IO", "to_io");
}
#ifndef NT