mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Avoid IOError when returning from Dir.open
Ignore `IOError` if `Dir#close` was done in the block.
This commit is contained in:
@@ -36,7 +36,10 @@ class Dir
|
||||
begin
|
||||
block.call(d)
|
||||
ensure
|
||||
d.close
|
||||
begin
|
||||
d.close
|
||||
rescue IOError
|
||||
end
|
||||
end
|
||||
else
|
||||
self.new(path)
|
||||
|
||||
Reference in New Issue
Block a user