summaryrefslogtreecommitdiffstats
path: root/Lib/_collections_abc.py
diff options
context:
space:
mode:
authorGéry Ogam <gery.ogam@gmail.com>2022-04-06 18:03:36 (GMT)
committerGitHub <noreply@github.com>2022-04-06 18:03:36 (GMT)
commit59a99ae277e7d9f47edd4a538c1239d39f10db0c (patch)
tree35c745df76cb7f06392c61639b3433976ed09cba /Lib/_collections_abc.py
parent884eba3c76916889fd6bff3b37b8552bfb4f9566 (diff)
downloadcpython-59a99ae277e7d9f47edd4a538c1239d39f10db0c.zip
cpython-59a99ae277e7d9f47edd4a538c1239d39f10db0c.tar.gz
cpython-59a99ae277e7d9f47edd4a538c1239d39f10db0c.tar.bz2
Minor code nit: Move an unrelated statement out of a try clause in Sequence.index (GH-32330)
Diffstat (limited to 'Lib/_collections_abc.py')
-rw-r--r--Lib/_collections_abc.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/_collections_abc.py b/Lib/_collections_abc.py
index 86eb042..e96e4c3 100644
--- a/Lib/_collections_abc.py
+++ b/Lib/_collections_abc.py
@@ -1022,10 +1022,10 @@ class Sequence(Reversible, Collection):
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