Skip to content

Commit f01aad3

Browse files
dbiebercopybara-github
authored andcommitted
Prevent error when all lines are blank in _strip_blank_lines.
PiperOrigin-RevId: 261784747 Change-Id: I40ac24b553b2b4fa081de3fe0b1250472e1011a7
1 parent c1a7e2f commit f01aad3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fire/docstrings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ def _strip_blank_lines(lines):
212212
"""
213213
# Find the first non-blank line.
214214
start = 0
215-
while lines and _is_blank(lines[start]):
215+
num_lines = len(lines)
216+
while lines and start < num_lines and _is_blank(lines[start]):
216217
start += 1
217218

218219
lines = lines[start:]

0 commit comments

Comments
 (0)