Skip to content

Commit

Permalink
Prevent error when all lines are blank in _strip_blank_lines.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 261784747
Change-Id: I40ac24b553b2b4fa081de3fe0b1250472e1011a7
  • Loading branch information
dbieber authored and copybara-github committed Aug 5, 2019
1 parent c1a7e2f commit f01aad3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fire/docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ def _strip_blank_lines(lines):
"""
# Find the first non-blank line.
start = 0
while lines and _is_blank(lines[start]):
num_lines = len(lines)
while lines and start < num_lines and _is_blank(lines[start]):
start += 1

lines = lines[start:]
Expand Down

0 comments on commit f01aad3

Please sign in to comment.