From ed2f8ea62ebe77bbb8408cb27b416c4a7f1023cc Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Tue, 18 Jun 2024 22:51:24 +0900 Subject: [PATCH] [DOC] IO#close on closed IO is not an error. --- io.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/io.c b/io.c index 8acb1f562e..54b60b7357 100644 --- a/io.c +++ b/io.c @@ -5699,6 +5699,9 @@ rb_io_close(VALUE io) * If the stream was opened by IO.popen, sets global variable $? * (child exit status). * + * It is not an error to close an IO object that has already been closed. + * It just returns nil. + * * Example: * * IO.popen('ruby', 'r+') do |pipe|