Skip to content

Commit 59a99ae

Browse files
authored
Minor code nit: Move an unrelated statement out of a try clause in Sequence.index (GH-32330)
1 parent 884eba3 commit 59a99ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/_collections_abc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,10 +1022,10 @@ def index(self, value, start=0, stop=None):
10221022
while stop is None or i < stop:
10231023
try:
10241024
v = self[i]
1025-
if v is value or v == value:
1026-
return i
10271025
except IndexError:
10281026
break
1027+
if v is value or v == value:
1028+
return i
10291029
i += 1
10301030
raise ValueError
10311031

0 commit comments

Comments
 (0)