From: Géry Ogam Date: Wed, 6 Apr 2022 18:03:36 +0000 (+0200) Subject: Minor code nit: Move an unrelated statement out of a try clause in Sequence.index... X-Git-Tag: v3.11.0b1~440 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=59a99ae277e7d9f47edd4a538c1239d39f10db0c;p=thirdparty%2FPython%2Fcpython.git Minor code nit: Move an unrelated statement out of a try clause in Sequence.index (GH-32330) --- diff --git a/Lib/_collections_abc.py b/Lib/_collections_abc.py index 86eb042e3a75..e96e4c353558 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