mirror of https://github.com/python/cpython.git
Minor code nit: Move an unrelated statement out of a try clause in Sequence.index (GH-32330)
This commit is contained in:
parent
884eba3c76
commit
59a99ae277
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue