forked from ruby/ruby
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not restart enumerator if it prematurely terminates due to exception
Previously, if an exception occurred during enumeration, the next call to Enumerator#next and similar methods would restart the Enumerator from the beginning, which is unlikely to be the desired behavior. This changes the behavior so that after the enumerator has raised an exception, future calls to Enumerator#next and similar methods will raise StopIteration, similar to when calling Enumerator#next after the enumerator has finished. Fixes [Bug #16816]
- Loading branch information
1 parent
5c4ff3f
commit 851534b
Showing
2 changed files
with
49 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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