From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS8972 188.138.9.0/24 X-Spam-Status: No, score=-2.0 required=3.0 tests=AWL,BAYES_00,RCVD_IN_XBL, URIBL_BLOCKED shortcircuit=no autolearn=no version=3.3.2 X-Original-To: rainbows-public@bogomips.org Received: from 80x24.org (atlantic480.us.unmetered.com [188.138.9.49]) by dcvr.yhbt.net (Postfix) with ESMTP id 8122A1F7DE for ; Mon, 14 Sep 2015 05:33:35 +0000 (UTC) From: Eric Wong To: rainbows-public@bogomips.org Subject: [PATCH 3/6] t/close-has-env.ru: ensure close is idempotent Date: Mon, 14 Sep 2015 05:33:15 +0000 Message-Id: <20150914053318.12251-4-e@80x24.org> In-Reply-To: <20150914053318.12251-1-e@80x24.org> References: <20150914053318.12251-1-e@80x24.org> List-Id: Ruby 2.3.0 will have idempotent IO#close, so closing an IO twice will be idempotent and not raise an IOError exception. Ensure we do not rely on the IOError exception to catch our own errors. --- t/close-has-env.ru | 1 + 1 file changed, 1 insertion(+) diff --git a/t/close-has-env.ru b/t/close-has-env.ru index 471f605..3b6ec88 100644 --- a/t/close-has-env.ru +++ b/t/close-has-env.ru @@ -10,6 +10,7 @@ class ClosablePipe < ::IO end def close + return if closed? # idempotent for Ruby 2.3.0 compatibility super $stdout.syswrite "path_info=#{@env['PATH_INFO']}\n" end -- EW