Skip to content

Commit b1dc64f

Browse files
Rewrite bounds check
1 parent a0f23d0 commit b1dc64f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/shared.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,11 @@ def update_readme(
220220
entry_start_index = lines.index(entry_start_line)
221221
entry_end_index = lines.index(entry_end_line)
222222
# Include any trailing empty/whitespace-only lines
223-
while (entry_end_index + 1 < len(lines)
224-
and not lines[entry_end_index + 1].strip()):
225-
entry_end_index += 1
223+
while entry_end_index + 1 < len(lines):
224+
if not lines[entry_end_index + 1].strip():
225+
entry_end_index += 1
226+
else:
227+
break
226228
# Initalize variables of entry is not present
227229
else:
228230
entry_start_index = None

0 commit comments

Comments
 (0)