Created
January 6, 2012 17:29
-
-
Save nagachika/1571568 to your computer and use it in GitHub Desktop.
patch for test_autoclose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb | |
index 76eb82c..0fbec35 100644 | |
--- a/test/ruby/test_io.rb | |
+++ b/test/ruby/test_io.rb | |
@@ -1409,13 +1409,15 @@ class TestIO < Test::Unit::TestCase | |
end | |
def try_fdopen(fd, autoclose = true, level = 100) | |
- if level > 0 | |
- try_fdopen(fd, autoclose, level - 1) | |
- GC.start | |
- level | |
- else | |
- IO.for_fd(fd, autoclose: autoclose) | |
- nil | |
+ 1.times do | |
+ if level > 0 | |
+ try_fdopen(fd, autoclose, level - 1) | |
+ GC.start | |
+ level | |
+ else | |
+ IO.for_fd(fd, autoclose: autoclose) | |
+ nil | |
+ end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment