Don't crash with empty lists
This commit is contained in:
parent
c74a36463e
commit
38837f5c4d
1 changed files with 4 additions and 1 deletions
|
|
@ -738,7 +738,10 @@ class Harness:
|
||||||
|
|
||||||
# Now that we know how many lines there are we can figure out how
|
# Now that we know how many lines there are we can figure out how
|
||||||
# many characters we need for the line number...
|
# many characters we need for the line number...
|
||||||
line_number_chars = int(math.log(len(lines), 10)) + 1
|
if len(lines) > 0:
|
||||||
|
line_number_chars = int(math.log(len(lines), 10)) + 1
|
||||||
|
else:
|
||||||
|
line_number_chars = 1
|
||||||
|
|
||||||
# ...which lets us wrap the lines appropriately.
|
# ...which lets us wrap the lines appropriately.
|
||||||
wrapper = textwrap.TextWrapper(
|
wrapper = textwrap.TextWrapper(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue