mirror of
https://github.com/kennethreitz/records.git
synced 2026-06-05 23:00:20 +00:00
Merge pull request #101 from ragne/master
Fixed accidental StopIteration bubbling in RecordCollection.__iter__
This commit is contained in:
+5
-1
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user