Just test for sys{read,write} in is_io()

This commit is contained in:
Andre Nathan 2013-12-06 10:38:58 -02:00
parent 892e1637b1
commit 057f8b3390

View file

@ -244,7 +244,8 @@ is_string_array(VALUE v)
static int
is_io(VALUE v)
{
return rb_obj_is_kind_of(v, rb_cIO) == Qtrue;
return rb_respond_to(v, rb_intern("sysread")) &&
rb_respond_to(v, rb_intern("syswrite"));
}
static void