Skip to content

Commit c78f09a

Browse files
authored
Merge pull request #19 from lschr/remove_stop_iteration
Don't raise StopIteration in generators
2 parents 7ec580d + fa2fd62 commit c78f09a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

slicerator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def _iter_attr(obj):
2020
for attr in ns.__dict__:
2121
yield ns.__dict__[attr]
2222
except AttributeError:
23-
raise StopIteration # obj has no __dict__
23+
return # obj has no __dict__
2424

2525

2626
class Slicerator(object):
@@ -347,7 +347,7 @@ def _index_generator(new_indices, old_indices):
347347
last_n = None
348348
break
349349
if done:
350-
raise StopIteration
350+
return
351351
if i == n:
352352
last_n = n
353353
try:

0 commit comments

Comments
 (0)