Skip to content

Commit

Permalink
Minor code nit: Move an unrelated statement out of a try clause in Se…
Browse files Browse the repository at this point in the history
…quence.index (pythonGH-32330)
  • Loading branch information
geryogam authored Apr 6, 2022
1 parent 884eba3 commit 59a99ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/_collections_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,10 +1022,10 @@ def index(self, value, start=0, stop=None):
while stop is None or i < stop:
try:
v = self[i]
if v is value or v == value:
return i
except IndexError:
break
if v is value or v == value:
return i
i += 1
raise ValueError

Expand Down

0 comments on commit 59a99ae

Please sign in to comment.