Merge pull request #101 from ragne/master

Fixed accidental StopIteration bubbling in RecordCollection.__iter__
This commit is contained in:
2017-02-04 13:25:38 -06:00
committed by GitHub
+5 -1
View File
@@ -118,7 +118,11 @@ class RecordCollection(object):
yield self[i]
else:
# Throws StopIteration when done.
yield next(self)
# Prevent StopIteration bubbling from generator, following https://www.python.org/dev/peps/pep-0479/
try:
yield next(self)
except StopIteration:
return
i += 1