Skip to content

Commit 867c8ee

Browse files
sampsoncclaude
andcommitted
gh-145678: Remove unnecessary try/except in test
The iterator is never exhausted at this point, so StopIteration cannot be raised. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 29df8e8 commit 867c8ee

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Lib/test/test_itertools.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -767,10 +767,7 @@ def __init__(self, val, do_advance):
767767
def __eq__(self, other):
768768
if self.do_advance:
769769
self.do_advance = False
770-
try:
771-
next(g)
772-
except StopIteration:
773-
pass
770+
next(g)
774771
return NotImplemented
775772
return self.val == other.val
776773

0 commit comments

Comments
 (0)