about summary refs log tree commit homepage
diff options
authorEric Wong <e@80x24.org>2015-09-14 05:33:15 +0000
committerEric Wong <e@80x24.org>2015-09-14 05:34:17 +0000
commit3358447d32b70e96f6cd48f05967306eafbc00d0 (patch)
parent25904f92de4c456d99fe4210430d58296f84a0af (diff)
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.
1 files changed, 1 insertions, 0 deletions
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
   def close
+    return if closed? # idempotent for Ruby 2.3.0 compatibility
     $stdout.syswrite "path_info=#{@env['PATH_INFO']}\n"