Skip to content

Commit 46d73d8

Browse files
DanielNoordcdce8p
andauthored
Update astroid/rebuilder.py
Co-authored-by: Marc Mueller <[email protected]>
1 parent 1938d5e commit 46d73d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

astroid/rebuilder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,7 @@ def _find_orelse_keyword(
13811381
start = node.orelse[0].lineno
13821382

13831383
# pylint: disable-next=unsubscriptable-object
1384-
for index, line in enumerate(self._data[start::-1]):
1384+
for index, line in enumerate(self._data[start:node.lineno:-1]):
13851385
if line.rstrip().startswith("else"):
13861386
return start - index + 1, line.index("else")
13871387
if line.rstrip().startswith("elif"):

0 commit comments

Comments
 (0)